[wp-trac] [WordPress Trac] #62305: Original HEIC image is not converted to JPEG

WordPress Trac noreply at wordpress.org
Wed Nov 6 17:06:59 UTC 2024


#62305: Original HEIC image is not converted to JPEG
--------------------------------------------------+-----------------------
 Reporter:  azaozz                                |       Owner:  azaozz
     Type:  defect (bug)                          |      Status:  reopened
 Priority:  normal                                |   Milestone:  6.7
Component:  Media                                 |     Version:  trunk
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch fixed-major has-unit-tests  |     Focuses:
--------------------------------------------------+-----------------------

Comment (by flixos90):

 I looked into this more closely and found a few reasons for the problem,
 probably requiring changes in both places for different things:

 * The bug reported by @mukesh27 above is an actual bug in the Modern Image
 Formats plugin itself, that as I now discovered has been there for quite a
 while, but so far was only "exposed" by big images, which we didn't have
 test coverage for. 😞 More context in
 https://github.com/WordPress/performance/pull/1635#issuecomment-2460323575.
 So this needs to be fixed in the plugin.
 * As a separate problem, [59317] does not check which MIME type to convert
 an image to. The `image_editor_output_format` can be used with an output
 array for each MIME type, and the Modern Image Formats plugin may specify
 the MIME type itself there too. For example, "for JPEG" input, the valid
 output format is "JPEG" and/or "WebP". If you think about it as a
 conversion map, this may seem weird, but the filter is about "output
 format", not "conversion map", so we cannot assume it's only used as the
 latter. Core may therefore currently try to convert a JPEG to a JPEG,
 which it shouldn't even attempt. We should only set the `$convert` flag to
 `true` if the output format only contains MIME types that differ from the
 input MIME type.

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


More information about the wp-trac mailing list