Skip to content

标清图过度压缩 #96

@halfpreschooler

Description

@halfpreschooler
  • (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);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions