wagtail icon indicating copy to clipboard operation
wagtail copied to clipboard

image.get_rendition(filter) returns incorrect rendition

Open funkhaus-phil opened this issue 7 months ago • 4 comments

Issue Summary

Uploading different Images with long and common filenames until basically the end of the filename is problematic when calling obj.get_rendition(filter). I expect to find the original image rendition but instead get the rendition of the image with the shortest common name.

Steps to Reproduce

  1. (for example) Start a new project with wagtail start myproject
  2. create a superuser
  3. start the server
  4. log into your backend
  5. prepare some different images with filenames like that: 093211_Kutter_Santa_Maria_Warnemunde.jpg 093211_Kutter_Santa_Maria_Warnemunde_DCI5332.jpg 093211_Kutter_Santa_Maria_Warnemunde_DCI5335.jpg
  6. navigate to images in the backend and upload those images
  7. come back to images to realise all your images use the same thumbnail, while pointing to the correct image on the detail page

Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead? When giving the backend into client hands we can't make sure they are following special conventions to avoid problems. Also clients like to upload folders full of images at once without inspecting all filenames. The Rendition should be the correct one for every image.

  • I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: no We also have a storage connected to the backend but i expect the problem inside of the get_rendition function from AbstractImage and expect the same behaviour on a fresh installation

Technical details

Working on this

Anyone can contribute to this. View our contributing guidelines, add a comment to the issue once you’re ready to start.

funkhaus-phil avatar Jul 18 '24 09:07 funkhaus-phil