Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

标清图过度压缩 #96

Open
lilangkit opened this issue Apr 2, 2021 · 3 comments
Open

标清图过度压缩 #96

lilangkit opened this issue Apr 2, 2021 · 3 comments

Comments

@lilangkit
Copy link

  • (NSData *)lf_fastestCompressImageDataWithSize:(CGFloat)size imageSize:(NSUInteger)imageSize;

标清图
建议支持传入最大尺寸做初步压缩 或者 最大压缩次数防止消耗太大

    /** 缩放图片 */
    if (currentResolution > MIN_UPLOAD_RESOLUTION) {
        float factor = sqrt(currentResolution / MIN_UPLOAD_RESOLUTION) * 2;
        compressedImage = [self lf_scaleWithSize:CGSizeMake(self.size.width / factor, self.size.height / factor)];
    }
    
    percent *= (targetSize/imageLength);

这一步压缩过度 且 压缩后没有检测是否已经符合要求

@lincf0912
Copy link
Owner

lincf0912 commented Apr 2, 2021 via email

@wuWeiFeng2
Copy link

请问如何解决标清图过渡压缩这个问题,大佬有给出解决办法么? 谢谢

@lincf0912
Copy link
Owner

lincf0912 commented Apr 29, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants