diff options
| author | Laurenz Stampfl <47084093+LaurenzV@users.noreply.github.com> | 2025-03-27 11:59:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-27 10:59:32 +0000 |
| commit | 838a46dbb7124125947bfdafe8ddf97810c5de47 (patch) | |
| tree | 2d28d9f6c27e8e48c91f47cea0966784027243dc /tests | |
| parent | 1f1c1338785dc09a43292cf106b4a23b4e1bd86e (diff) | |
Test all exif rotation types and fix two of them (#6102)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/image-exif-rotation.png | bin | 0 -> 1392 bytes | |||
| -rw-r--r-- | tests/ref/issue-870-image-rotation.png | bin | 200 -> 0 bytes | |||
| -rw-r--r-- | tests/suite/visualize/image.typ | 19 |
3 files changed, 13 insertions, 6 deletions
diff --git a/tests/ref/image-exif-rotation.png b/tests/ref/image-exif-rotation.png Binary files differnew file mode 100644 index 00000000..a319a5c5 --- /dev/null +++ b/tests/ref/image-exif-rotation.png diff --git a/tests/ref/issue-870-image-rotation.png b/tests/ref/issue-870-image-rotation.png Binary files differdeleted file mode 100644 index c321a1a9..00000000 --- a/tests/ref/issue-870-image-rotation.png +++ /dev/null diff --git a/tests/suite/visualize/image.typ b/tests/suite/visualize/image.typ index 7ce0c8c0..9a77870a 100644 --- a/tests/suite/visualize/image.typ +++ b/tests/suite/visualize/image.typ @@ -247,12 +247,6 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B format: "rgba8", ) ---- issue-870-image-rotation --- -// Ensure that EXIF rotation is applied. -// https://github.com/image-rs/image/issues/1045 -// File is from https://magnushoff.com/articles/jpeg-orientation/ -#image("/assets/images/f2t.jpg", width: 10pt) - --- issue-measure-image --- // Test that image measurement doesn't turn `inf / some-value` into 0pt. #context { @@ -267,3 +261,16 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B --- issue-3733-dpi-svg --- #set page(width: 200pt, height: 200pt, margin: 0pt) #image("/assets/images/relative.svg") + +--- image-exif-rotation --- +#let data = read("/assets/images/f2t.jpg", encoding: none) + +#let rotations = range(1, 9) +#let rotated(v) = image(data.slice(0, 49) + bytes((v,)) + data.slice(50), width: 10pt) + +#set page(width: auto) +#table( + columns: rotations.len(), + ..rotations.map(v => raw(str(v), lang: "typc")), + ..rotations.map(rotated) +) |
