aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-08-09 17:54:14 +0200
committerBjørn Erik Pedersen <[email protected]>2024-08-10 14:00:21 +0200
commitfbfccb394b8ead6435375f9dc6ae07e9df60e860 (patch)
treedef808bbc3c9f9914014a41e7961749d312eb231 /resources
parentef2e30eca3799e3835b1ec4c20f6f30b7237715f (diff)
downloadhugo-fbfccb394b8ead6435375f9dc6ae07e9df60e860.tar.gz
hugo-fbfccb394b8ead6435375f9dc6ae07e9df60e860.zip
Fix compare of uints and ints in eq, gt etc.
Fixes #12733
Diffstat (limited to 'resources')
-rw-r--r--resources/images/images_integration_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/resources/images/images_integration_test.go b/resources/images/images_integration_test.go
index 156de6259..caba42e03 100644
--- a/resources/images/images_integration_test.go
+++ b/resources/images/images_integration_test.go
@@ -34,3 +34,19 @@ W/H rotated: {{ $rotated.Width }}/{{ $rotated.Height }}
b := hugolib.Test(t, files)
b.AssertFileContent("public/index.html", "W/H original: 80/40\n\nW/H rotated: 40/80")
}
+
+// Issue 12733.
+func TestOrientationEq(t *testing.T) {
+ files := `
+-- hugo.toml --
+-- assets/rotate270.jpg --
+sourcefilename: ../testdata/exif/orientation6.jpg
+-- layouts/index.html --
+{{ $img := resources.Get "rotate270.jpg" }}
+{{ $orientation := $img.Exif.Tags.Orientation }}
+Orientation: {{ $orientation }}|eq 6: {{ eq $orientation 6 }}|Type: {{ printf "%T" $orientation }}|
+`
+
+ b := hugolib.Test(t, files)
+ b.AssertFileContent("public/index.html", "Orientation: 6|eq 6: true|")
+}