]> git.99rst.org Git - openwrt-packages.git/commitdiff
graphicsmagick: expand test.sh coverage
authorAlexandru Ardelean <redacted>
Tue, 4 Aug 2026 18:26:20 +0000 (21:26 +0300)
committerAlexandru Ardelean <redacted>
Fri, 7 Aug 2026 08:27:13 +0000 (11:27 +0300)
Exercise more gm subcommands and codecs on top of the existing PNG/JPEG,
resize, pixel, draw and composite checks: TIFF round-trip, PPM and GIF
encoders, crop, 90-degree rotate, horizontal append and in-place mogrify.

Signed-off-by: Alexandru Ardelean <redacted>
multimedia/graphicsmagick/test.sh

index 7fa1f2ea499c15fe5522a32c492605dcc81463c9..ae169627cec21d622739651caaba2276ef9bab4b 100644 (file)
@@ -35,7 +35,39 @@ graphicsmagick)
        gm composite -compose Over /tmp/gm-red.png /tmp/gm-white.png /tmp/gm-composite.png
        gm identify /tmp/gm-composite.png | grep "PNG"
 
+       # TIFF round-trip: encode, then decode back to PNG at the same geometry
+       gm convert /tmp/gm-white.png /tmp/gm-white.tiff
+       gm identify /tmp/gm-white.tiff | grep "TIFF"
+       gm convert /tmp/gm-white.tiff /tmp/gm-back.png
+       gm identify /tmp/gm-back.png | grep -E "PNG.*32x32"
+
+       # PPM and GIF encoders (built-in codecs)
+       gm convert /tmp/gm-white.png /tmp/gm-white.ppm
+       gm identify /tmp/gm-white.ppm | grep -E "PNM|PPM"
+       gm convert /tmp/gm-white.png /tmp/gm-white.gif
+       gm identify /tmp/gm-white.gif | grep "GIF"
+
+       # Crop a sub-region and confirm the new geometry
+       gm convert /tmp/gm-white.png -crop 10x10+0+0 /tmp/gm-crop.png
+       gm identify /tmp/gm-crop.png | grep -E "PNG.*10x10"
+
+       # Rotate 90 degrees swaps width and height
+       gm convert -size 40x20 xc:white -rotate 90 /tmp/gm-rot.png
+       gm identify /tmp/gm-rot.png | grep -E "PNG.*20x40"
+
+       # Horizontal append of two images
+       gm convert /tmp/gm-white.png /tmp/gm-small.png +append /tmp/gm-app.png
+       gm identify /tmp/gm-app.png | grep "PNG"
+
+       # mogrify rewrites the file in place
+       cp /tmp/gm-white.png /tmp/gm-mog.png
+       gm mogrify -resize 20x20! /tmp/gm-mog.png
+       gm identify /tmp/gm-mog.png | grep -E "PNG.*20x20"
+
        rm -f /tmp/gm-white.png /tmp/gm-white.jpg /tmp/gm-small.png \
-             /tmp/gm-red.png /tmp/gm-text.png /tmp/gm-composite.png
+             /tmp/gm-red.png /tmp/gm-text.png /tmp/gm-composite.png \
+             /tmp/gm-white.tiff /tmp/gm-back.png /tmp/gm-white.ppm \
+             /tmp/gm-white.gif /tmp/gm-crop.png /tmp/gm-rot.png /tmp/gm-app.png \
+             /tmp/gm-mog.png
        ;;
 esac
git clone https://git.99rst.org/PROJECT