Opened 6 years ago
Closed 6 years ago
#50616 closed defect (bug) (invalid)
Image cropping API returns on wrong image.
| Reported by: | spacedmonkey | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Media | Version: | 5.5 |
| Severity: | major | Keywords: | needs-patch reporter-feedback |
| Cc: | Focuses: | rest-api |
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
@
6 years ago
- Keywords reporter-feedback added
- Priority normal → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Before crop