Opened 4 years ago
Closed 4 years ago
#50616 closed defect (bug) (invalid)
Image cropping API returns on wrong image.
Reported by: | 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)
Change History (7)
#2
@
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.
Before crop