Make WordPress Core

Opened 11 years ago

Last modified 16 months ago

#23436 accepted defect (bug)

Media Gallery - Cropping Image and then Cropping a thumbnail from that crop doesn't work.

Reported by: gr33nman's profile gr33nman Owned by: joedolson's profile joedolson
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: needs-patch reporter-feedback close 2nd-opinion media-edit
Focuses: Cc:

Description

A recipe for repeating the bug behavior:

Navigate to Library in the admin sidebar.

Click "Add new".

Drag the 800x480 copy of this or any image to the drag and drop area:

http://en.wikipedia.org/wiki/File:Cheese_platter.jpg

(I suggest this image for ease of recipe duplication and best explanation.)

After the blue status bar has completed, "Edit" to bring the media edit window up in a new tab.

Click "Edit Image" below the actual image.

Drag anywhere inside the image to create a cropping box.

In the "Image crop" pane, set the crop area to 500px width, 100px height.

Drag the cropping box so that the fancy toothpick is as far left as possible along the horizontal axis of the cropping box, but centered vertically.

Click the "Crop" icon. Click "Save". Click "Update".

Click "Edit Image" once again.

Drag inside the newly-cropped image again to create a new cropping box.

In the "Image Crop" pane, change the cropping dimensions to 150 x 100.

Drag the box so the fancy toothpick is somewhere in the left third within the crop boundary.

Important: In the thumbnail settings pane, set "Apply Settings to:" Thumbnail.

Click the "Crop" icon. Click "Save". Click "Update".

Click "Library" in the admin sidebar.

The newly preferred thumbnail for our previously-cropped image does not save. Thumbnail remains default, based on center of previously-cropped image. Instead, you will see a small wheel of cheese sliced into six wedges with garnishes for the thumbnail, even though we chose the part with the fancy toothpick.

Change History (10)

#1 @markoheijnen
11 years ago

  • Severity changed from normal to minor

The bug can be explained in the way that when you crop an image that small the edited full image will be the thumbnail. So no need to have two images. The whole flow of editing images needs to be revisited. There are a lot of weird thing going on.

#2 @chriscct7
9 years ago

  • Severity changed from minor to normal
  • Version changed from 3.5.1 to 3.5

#3 @desrosj
5 years ago

  • Keywords reporter-feedback close 2nd-opinion added

I went through the steps above and I was able to confirm the thumbnail does not save when a crop is applied. However, I think this is happening because the size in the steps above is smaller than the thumbnail size (150x150 by default).

If I change the thumbnail dimensions to 150x100 on the Settings > Media page, then the steps above correctly updates the thumbnail crop.

I am inclined to close this out, but I also would not be opposed to showing some type of notice when the user tries to crop the thumbnail image to a size that is too small.

#4 @hellofromTonya
3 years ago

@antpb What do you think?

This ticket was mentioned in Slack in #core-media by hellofromtonya. View the logs.


3 years ago

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.


3 years ago

#7 @antpb
3 years ago

  • Keywords media-edit added

Adding a new keyword of media-edit so we can track this alongside other initiatives involving editing media going forward. it's widely agreed the cropping experience could use an overhaul and this keyword will help us work toward that.

#8 @antonvlasenko
16 months ago

I've worked on fixing a similar issue: https://core.trac.wordpress.org/ticket/55070.
I agree with @markoheijnen here:

The bug can be explained in the way that when you crop an image that small the edited full image will be the thumbnail. So no need to have two images. The whole flow of editing images needs to be revisited.

But I can hardly imagine how to do change the logic that is responsible for uploading images without breaking BC.

Reproduction Report

This report validates that the issue can be reproduced.

Environment

  • OS: macOS 12.6
  • Web Server: Apache
  • PHP: 8.1
  • WordPress: 6.2-alpha-54642-src
  • Browser: Safari 16.0
  • Theme: Twenty Twenty-Two
  • Active Plugins:
    • None

Steps to Reproduce

  1. Upload this image to the Media Gallery: https://upload.wikimedia.org/wikipedia/commons/thumb/a/a8/Cheese_platter.jpg/800px-Cheese_platter.jpg
  2. Click on the image.
  3. Click on the "Edit Image" button below the image.
  4. Crop the image (using the "Crop" button above the image).
  5. A cropped image should be 500 x 100 pixels in size.
  6. Save the cropped image (click on the "Save" button).
  7. Crop the image (using the "Crop" button above the image).
  8. A cropped image should be 150 x 100 pixels in size.
  9. Save the cropped image (click on the "Save" button).

Actual Results

  • The image on the Media Library page (/wp-admin/upload.php) doesn't match the image that was cropped (see steps 8, 9).

So this bug can still be reproduced.

Last edited 16 months ago by antonvlasenko (previous) (diff)

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.


16 months ago

#10 @joedolson
16 months ago

  • Owner set to joedolson
  • Status changed from new to accepted
Note: See TracTickets for help on using tickets.