[wp-trac] [WordPress Trac] #63773: Palette-based PNG cause failure attempting AVIF/WebP conversion under GD

WordPress Trac noreply at wordpress.org
Thu Jul 31 16:23:28 UTC 2025


#63773: Palette-based PNG cause failure attempting AVIF/WebP conversion under GD
-----------------------------+-----------------------------
 Reporter:  adamsilverstein  |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Media            |    Version:  5.8
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 When uploading a palette based PNG image and attempting to use core's
 `image_editor_output_format` to output WebP or AVIF images, conversion
 fails with a fatal error when using GD. GD cannot convert palette-based
 PNG to WebP/AVIF formats so to fix the issue, a palette image is first
 converted to truecolor (`imagepalettetotruecolor`). Testing shows the
 fatal is resolved and the resulting images are still significantly smaller
 than their PNG counterparts.


 This issue was originally reported in the Performance Lab Modern Images
 plugin - https://github.com/WordPress/performance/issues/1561. The issue
 is fixed by this PR in the plugin:
 https://github.com/WordPress/performance/pull/2024. The purpose of this
 ticket is to bring that fix directly into core, into WP_Image_Editor_GD.

 We can start by adding a unit test to demonstrate the issue.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63773>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list