Skip to content

Commit

Permalink
Take greater advantage of the JPEG shrink-on-load feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Dec 30, 2023
1 parent 2be083a commit d61b33c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions libvips/resample/thumbnail.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,12 @@ vips_thumbnail_find_jpegshrink(VipsThumbnail *thumbnail,
* extra sharpness to the image. We want to block shrink to a
* bit above our target, then vips_shrink() / vips_reduce() to the
* final size.
*
* Leave at least a factor of two for the final resize step.
*/
if (shrink >= 16)
if (shrink >= 9)
return 8;
else if (shrink >= 8)
else if (shrink >= 5)
return 4;
else if (shrink >= 4)
else if (shrink >= 3)
return 2;
else
return 1;
Expand Down

0 comments on commit d61b33c

Please sign in to comment.