resources: Fix 2 image file cache key issues

* Always include the content hash in the cache key for unprocessed images.
* Always include the image config hash in the cache key.

This is also a major cleanup/simplification of the implementation in this area.

Note that this, unfortunately, forces new hashes/filenames for generated images.

Fixes #13273
Fixes #13272
This commit is contained in:
Bjørn Erik Pedersen 2025-01-16 19:15:30 +01:00
parent 8897113666
commit 1f5a15aba0
38 changed files with 342 additions and 233 deletions

View file

@ -42,6 +42,6 @@ func TestImageResizeWebP(t *testing.T) {
resized, err := image.Resize("123x")
c.Assert(err, qt.IsNil)
c.Assert(image.MediaType(), qt.Equals, media.Builtin.WEBPType)
c.Assert(resized.RelPermalink(), qt.Equals, "/a/sunrise_hu544374262273649331.webp")
c.Assert(resized.RelPermalink(), qt.Equals, "/a/sunrise_hu_a1deb893888915d9.webp")
c.Assert(resized.Width(), qt.Equals, 123)
}