[wp-trac] [WordPress Trac] #61597: Resized images larger in filesize than original, when setting jpeg_quality to 100

WordPress Trac noreply at wordpress.org
Mon Jul 8 22:00:35 UTC 2024


#61597: Resized images larger in filesize than original, when setting jpeg_quality
to 100
--------------------------+------------------------------
 Reporter:  johnny538     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  6.5.5
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by adamsilverstein):

 Hi @johnny538 thanks for the bug report.

 > I prefer to optimize my images before I upload them. One of the reasons
 is so I can avoid image optimization plugins.

 This will work for the original or main image you upload which WordPress
 leaves untouched. However, for the "generated" image sizes that core
 creates and then uses for image `srcset` entries, this relies on Imagick
 or GD to create the images- you can't override these images directly as a
 user (at least, not without a plugin). As you mentioned, you can control
 the quality setting used when generating these images.


 > This works like intended. My original image remains the same file size.
 Note WordPress never alters the original image, regardless of the quality
 setting.

 > But when WordPress resizes images according to all the registered sizes,
 they're often much larger than the original,

 I think that is to be expected with a quality setting of 100, this could
 easily create larger that the original sized images especially if the
 original had a lower quality setting.

 > The resized versions, if smaller in dimensions, should also be smaller
 in file size. Or generation should be skipped entirely if the file size is
 larger.

 that should generally be true with the default 82 quality setting. Also,
 some users might still want the images generated even if larger, so they
 don't experience broken or missing image sizes for responsive layouts.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61597#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list