Closed maethu closed 1 year ago
@petschki I'm sorry can't really tell what's wrong with the tests. I might need help to fix those.
Somehow the test is broken after merging it into master. @maethu could you eventually take a look again?
strange, the strings look exactly the same
strange, the strings look exactly the same
which is the problem, they shouldn't :)
Problem:
Even though an image gets changed via cropping it does maintain the same url. Which leads cache/proxy and browsers to potentially not download the new version of the cropped image.
Example: After uploading a new image the url to the thumb scale is http://nohost/plone/testimage/@@images/image-128-fba13e5e2040bf30b80360aeaf2bb42f.png
After cropping the url is still http://nohost/plone/testimage/@@images/image-128-fba13e5e2040bf30b80360aeaf2bb42f.png
Explenation: One part of the hash key in the default storage (IImageScaleStorage) is the _p_mtime (modification time if an object got changed during a transaction). This is basically the only parameter that we can change, without rewriting the storage, image factory and utilities.
Solution: Mark the ImageBlobField as changed if a scale gets cropped. This way we force the storage to generate a new has key for (all) the scales.