WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 6 months ago

#37244 reviewing defect (bug)

WordPress has a fallback if the cropped version of an image is smaller than the size the contributor sets it to be

Reported by: rasmusrim Owned by: joemcgill
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.5.3
Component: Media Keywords: close
Focuses: Cc:
PR Number:

Description

I have cropped an image in WordPress to a certain size. If I insert that image into a post and select that that image should have a size larger than the size of the cropped image, it seems to me that WordPress chooses to use the original, uncropped image instead.

That should not happen. If I have cropped an image, I usually have a reason for it. Could there be a warning displayed instead saying that "This image is too small. It will not look nice"?

Change History (4)

#1 follow-up: @joemcgill
3 years ago

  • Owner set to joemcgill
  • Status changed from new to reviewing

Hi @rasmusrim,

Thanks for the report, and welcome to Trac. It's not clear to me from your description exactly what is happening here. Could you provide specific steps someone would follow to reproduce the issue? Thanks.

#2 in reply to: ↑ 1 @rasmusrim
3 years ago

Alright... sorry about that. I'll try to be more structured:

  1. I upload a file with the size 2560x1600 into the media library.
  2. I hard crop that file to a size of 345x332 using the in-built tool that WordPress has. Another version of the image with a sort of hash added to the file name, turns up in "uploads".
  3. I create a new page where I add that file using the size setting "Large" which is set to 640x400.
  4. The uncropped version of the image shows up. Probably because the settings for "Large" are larger than the size of the cropped version of the image.
  5. If I, however choose a custom size we have, which is 100x100, the cropped version shows up.

WordPress going back to the uncropped image is highly unwanted behaviour, so I am wondering if that is a bug or a feature :)

Replying to joemcgill:

Hi @rasmusrim,

Thanks for the report, and welcome to Trac. It's not clear to me from your description exactly what is happening here. Could you provide specific steps someone would follow to reproduce the issue? Thanks.

#3 @desrosj
6 months ago

  • Keywords close added

Hi @rasmusrim,

Thanks for the additional details. In my testing, I am able to reproduce what you have described. I believe this is intended behavior, though. If the image is smaller than the selected image size, WordPress will attempt to match with the next largest size, even if it does not reflect the new crop.

@joemcgill can you confirm?

#4 @joemcgill
6 months ago

@desrosj I think this is the same behavior reported in #43816, if I'm not mistaken. I'm unsure if this was intended behavior or not, but it sure does seem unexpected from a UX point of view.

Note: See TracTickets for help on using tickets.