Skip to content

Commit

Permalink
resources: Increment the meta cache version
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Jul 15, 2021
1 parent fd1f1a1 commit 0bb01ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hugolib/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ SUNSET2: {{ $resized2.RelPermalink }}/{{ $resized2.Width }}/Lat: {{ $resized2.Ex
// Check the file cache
b.AssertImage(200, 200, "resources/_gen/images/bundle/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_200x200_resize_q75_box.jpg")

b.AssertFileContent("resources/_gen/images/bundle/sunset_3166614710256882113.json",
b.AssertFileContent("resources/_gen/images/bundle/sunset_9750822043026343402.json",
"DateTimeDigitized|time.Time", "PENTAX")
b.AssertImage(123, 234, "resources/_gen/images/sunset_hu59e56ffff1bc1d8d122b1403d34e039f_90587_123x234_resize_q75_box.jpg")
b.AssertFileContent("resources/_gen/images/sunset_3166614710256882113.json",
b.AssertFileContent("resources/_gen/images/sunset_9750822043026343402.json",
"DateTimeDigitized|time.Time", "PENTAX")

// TODO(bep) add this as a default assertion after Build()?
Expand Down
3 changes: 2 additions & 1 deletion resources/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ func (i *imageResource) setBasePath(conf images.ImageConfig) {
}

func (i *imageResource) getImageMetaCacheTargetPath() string {
const imageMetaVersionNumber = 1 // Increment to invalidate the meta cache
// Version 2: Hugo 0.86 got a new Exif library.
const imageMetaVersionNumber = 2 // Increment to invalidate the meta cache

cfgHash := i.getSpec().imaging.Cfg.CfgHash
df := i.getResourcePaths().relTargetDirFile
Expand Down

0 comments on commit 0bb01ba

Please sign in to comment.