From: Alexandru Ardelean Date: Tue, 4 Aug 2026 18:26:20 +0000 (+0300) Subject: imagemagick: expand test.sh coverage X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=b0536d3ff62bdb635ef8cb0d469e6d90004e4cba;p=openwrt-packages.git imagemagick: expand test.sh coverage Exercise more of the toolchain on top of the existing PNG/JPEG/BMP, resize, pixel-sampling, grayscale and composite checks: TIFF round-trip, PPM and GIF encoders, crop, 90-degree rotate, horizontal append, the IM7 'magick' driver and in-place mogrify. Signed-off-by: Alexandru Ardelean --- diff --git a/multimedia/imagemagick/test.sh b/multimedia/imagemagick/test.sh index 82da005f1..847503fba 100644 --- a/multimedia/imagemagick/test.sh +++ b/multimedia/imagemagick/test.sh @@ -44,7 +44,43 @@ imagemagick) -gravity Center -composite /tmp/im-comp.png identify /tmp/im-comp.png | grep "PNG" + # TIFF round-trip: encode, then decode back to PNG at the same geometry + convert /tmp/im-white.png /tmp/im-white.tiff + identify /tmp/im-white.tiff | grep "TIFF" + convert /tmp/im-white.tiff /tmp/im-back.png + identify /tmp/im-back.png | grep -E "PNG.*32x32" + + # PPM and GIF encoders (built-in codecs) + convert /tmp/im-white.png /tmp/im-white.ppm + identify /tmp/im-white.ppm | grep -E "PNM|PPM" + convert /tmp/im-white.png /tmp/im-white.gif + identify /tmp/im-white.gif | grep "GIF" + + # Crop a sub-region; +repage drops the virtual canvas offset + convert /tmp/im-white.png -crop 10x10+0+0 +repage /tmp/im-crop.png + identify /tmp/im-crop.png | grep -E "PNG.*10x10" + + # Rotate 90 degrees swaps width and height + convert -size 40x20 xc:white -rotate 90 /tmp/im-rot.png + identify /tmp/im-rot.png | grep -E "PNG.*20x40" + + # Horizontal append of two images + convert /tmp/im-white.png /tmp/im-small.png +append /tmp/im-app.png + identify /tmp/im-app.png | grep "PNG" + + # The IM7 'magick' driver must work as well as the legacy tools + magick -size 24x24 xc:green /tmp/im-magick.png + identify /tmp/im-magick.png | grep -E "PNG.*24x24" + + # mogrify rewrites the file in place + cp /tmp/im-white.png /tmp/im-mog.png + mogrify -resize 20x20! /tmp/im-mog.png + identify /tmp/im-mog.png | grep -E "PNG.*20x20" + rm -f /tmp/im-white.png /tmp/im-white.jpg /tmp/im-small.png \ - /tmp/im-red.png /tmp/im-white.bmp /tmp/im-gray.png /tmp/im-comp.png + /tmp/im-red.png /tmp/im-white.bmp /tmp/im-gray.png /tmp/im-comp.png \ + /tmp/im-white.tiff /tmp/im-back.png /tmp/im-white.ppm \ + /tmp/im-white.gif /tmp/im-crop.png /tmp/im-rot.png /tmp/im-app.png \ + /tmp/im-magick.png /tmp/im-mog.png ;; esac