WordPress.org

Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#53941 new defect (bug)

When converting images after uploading the original image may not be converted

Reported by: azaozz Owned by:
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.8
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

This is less noticeable when the original image is larger than the "big image threshold" (and not a PNG) as the scaled image is converted.

To reproduce:

  • Set image conversion, for example GIF to JPEG.
  • Upload image.gif that is smaller than 2560x2560px.
  • Note that image.gif is listed in the Gallery and present in the uploads directory but it's sub-sizes have been converted to JPEGs like image-150x150.jpg, etc.

Expected behavior: the original image should be converted.

Change History (3)

#1 follow-up: @costdev
4 weeks ago

Hi @azaozz, thanks for raising this ticket!

Can you also add how you're setting the image conversion, for example GIF to JPEG?

I assume that you're using something akin to this?

<?php

add_filter(
        'image_editor_output_format',
        function( $formats ) {
                $formats['image/gif'] = 'image/jpeg';

                return $formats;
        }
);
Last edited 4 weeks ago by costdev (previous) (diff)

#2 in reply to: ↑ 1 @azaozz
4 weeks ago

Replying to costdev:

Yes, using the image_editor_output_format filter.

#3 @azaozz
4 weeks ago

  • Keywords needs-patch added
Note: See TracTickets for help on using tickets.