Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#50616 closed defect (bug) (invalid)

Image cropping API returns on wrong image.

Reported by: spacedmonkey's profile spacedmonkey Owned by:
Milestone: Priority: high
Severity: major Version: 5.5
Component: Media Keywords: needs-patch reporter-feedback
Focuses: rest-api Cc:

Description

If I edit 3 images with similar names, I get the wrong image returned.

Example.
Image one - unsplash-blah.jpg
Image two - unsplash-wow.jpg
Image three - unsplash-pow.jpg

Returned
Image one - unsplash-cropped.jpg
Image two - unsplash-cropped.jpg
Image three - unsplash-cropped.jpg

For some reason it returned the first image. I believe the issue is related to wp_unique_filename not getting a unique filename.

Tested in WordPress 5.5-beta1-48404

Attachments (2)

Screenshot 2020-07-08 at 17.58.51.png (1.1 MB) - added by spacedmonkey 4 years ago.
Before crop
Screenshot 2020-07-08 at 17.59.05.png (1.2 MB) - added by spacedmonkey 4 years ago.
After crop, replaced with wrong image.

Change History (7)

@spacedmonkey
4 years ago

After crop, replaced with wrong image.

#1 @johnbillion
4 years ago

  • Milestone changed from Awaiting Review to 5.5

#2 @azaozz
4 years ago

  • Keywords reporter-feedback added
  • Priority changed from normal to high

Seems I'm missing something. What (UI) do you use to crop the images? Not sure anything in core appends -cropped to file names. When using the wp_crop_image() standalone function it prepends cropped- before the name.

Tried reproducing with the new image editing from the block editor and it appears to be working correctly. The edited images were named unsplash-blah-edited.jpg, unsplash-blah-edited-1.jpg, etc.

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


4 years ago

This ticket was mentioned in Slack in #core-restapi by timothybjacobs. View the logs.


4 years ago

#5 @TimothyBlynJacobs
4 years ago

  • Milestone 5.5 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Closing this based on discussion in #core-restapi. It looks like this was a false positive in the testing environment.

Note: See TracTickets for help on using tickets.