WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 7 months ago

Last modified 7 months ago

#38530 closed defect (bug) (duplicate)

Uploading a 512x512 site icon creates a "cropped" duplicate in media library

Reported by: adamkheckler Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: Customize Keywords:
Focuses: Cc:

Description

To reproduce:

  1. Install latest stable WP (4.6.1 currently) using Twenty Sixteen theme. No plugins.
  2. Find an image that's exactly 512x512 pixels.
  3. In the Customizer, go to Site Identity and click Select Image in the Site Icon section.
  4. Upload the 512x512 image you prepared in Step 2.
  5. Your site icon is uploaded. Click Save and Publish.
  6. Look in your Media Library.

Expectation: one image present, which should be the image you just uploaded at the recommended size.

Reality: your original image is there, but there's also a duplicate prepended with "cropped-".

IMAGE1

I don't understand why an image that's already 512x512 needs to be cropped. The resulting images are exactly the same dimensions and filesize.

Here's what it looks like in the uploads directory:

IMAGE2

At first glance, I thought this was a recurrence of this ticket:

https://core.trac.wordpress.org/ticket/33011

... but the filenames aren't quite the same, so I suspect it's a new bug.

Attachments (2)

Screen Shot 2016-10-27 at 1.04.30 PM.png (37.3 KB) - added by adamkheckler 5 years ago.
Screen Shot 2016-10-27 at 1.05.27 PM.png (87.7 KB) - added by adamkheckler 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @mdgl
5 years ago

Confirmed. I have noticed this before and find the behaviour rather annoying! Having read #33011 I got the impression it might be intentional, but I don't understand the reason why we need to duplicate the media item in this manner. Yes, we might be pre-generating more image file "sizes", but as far as I can see these shouldn't conflict with other uses of the image. In any case, this image file generation is really just a performance optimisation that WordPress should be able to manage automatically in the background and without making it visible to the user by duplicating the media item.

#2 @celloexpressions
7 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version changed from 4.6.1 to 4.3

This is in fact the intended behavior as further discussed in #33011. The term "cropped" is used for consistency with cases where the image was actually cropped, but in reality means that there is a duplicate attachment post specifically representing the site icon and its associated cropped/resized variations.

#3 @celloexpressions
7 months ago

Also noting, for those annoyed with this behavior, than you can delete the original (non-cropped) version from the media library after the duplicated site-icon-specific "cropped" copy is created. If you don't want to see both versions in the media library.

Note: See TracTickets for help on using tickets.