WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 6 months ago

#49995 new defect (bug)

WordPress creates unnecessary thumbnails

Reported by: XXVII Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4
Component: Media Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Hello,
I think I found a bug in WordPress 5.3 onwards, when imagick is installed and activated on the server (PHP 7.3, phpinfo attached).

To reproduce the problem:

1 - in /wp-admin/options-media.php check what sizes are set (defaults are: 1024x1024, 300x300x 150x150)

2 - upload an image with the same size as one of the three, let's say I upload this image https://via.placeholder.com/1024x1024

3 - WordPress uploads the image and generates the following files
1024x1024.png -> original image
1024x1024-1024x1024.png -> SHOULD NOT BE CREATED
1024x1024-768x768.png -> medium_large
1024x1024-300x300.png -> medium
1024x1024-150x150.png -> thumbnail

1024x1024-1024x1024.png should not be generated, it's also bigger than the original (3.5kB vs 6.3kB).

The same thing happens with the other sizes as long as the image size is the same as one of the sizes set in the options.

It doesn't happen on Wordpress 5.2.x and downwards.

To solve the problem imagick must be deactivated, using GD the problem doesn't happen.

Attachments (1)

phpinfo.html (95.6 KB) - added by XXVII 6 months ago.
phpinfo

Download all attachments as: .zip

Change History (3)

@XXVII
6 months ago

phpinfo

This ticket was mentioned in Slack in #core by xxvii. View the logs.


6 months ago

#2 @SergeyBiryukov
6 months ago

  • Description modified (diff)

Possibly related: #47713

Note: See TracTickets for help on using tickets.