wagtail
wagtail copied to clipboard
image.get_rendition(filter) returns incorrect rendition
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
- (for example) Start a new project with
wagtail start myproject
- create a superuser
- start the server
- log into your backend
- 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
- navigate to images in the backend and upload those images
- 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
- Python version: 3.8.*
- Django version: 3.1.*
- Wagtail version: 2.15.6
- Browser version: https://www.whatsmybrowser.org/b/JPN6N
Working on this
Anyone can contribute to this. View our contributing guidelines, add a comment to the issue once you’re ready to start.