Merge pull request #36 from SDWebImage/fix_max_file_size_passes
Fix that the max file size encoding need to increase the passes used by libwebp, we choose to use 6 from cwebp command line
This commit is contained in:
commit
e25194e655
|
@ -781,6 +781,7 @@ static CGSize SDCalculateThumbnailSize(CGSize fullSize, BOOL preserveAspectRatio
|
||||||
}
|
}
|
||||||
|
|
||||||
config.target_size = (int)fileSize; // Max filesize for output, 0 means use quality instead
|
config.target_size = (int)fileSize; // Max filesize for output, 0 means use quality instead
|
||||||
|
config.pass = fileSize > 0 ? 6 : 1; // Use 6 passes for file size limited encoding, which is the default value of `cwebp` command line
|
||||||
config.thread_level = 1; // Thread encoding for fast
|
config.thread_level = 1; // Thread encoding for fast
|
||||||
config.lossless = 0; // Disable lossless encoding (If we need, can add new Encoding Options in future version)
|
config.lossless = 0; // Disable lossless encoding (If we need, can add new Encoding Options in future version)
|
||||||
picture.use_argb = config.lossless; // Lossy encoding use YUV for internel bitstream
|
picture.use_argb = config.lossless; // Lossy encoding use YUV for internel bitstream
|
||||||
|
|
Loading…
Reference in New Issue