3 # Copyright (c) 2013 John Cunningham Bowler
5 # Last changed in libpng 1.6.0 [February 14, 2013]
7 # This code is released under the libpng license.
8 # For conditions of distribution and use, see the disclaimer
11 # Generate a set of PNG test images. The images are generated in a
12 # sub-directory called 'tests' by default, however a command line argument will
13 # change that name. The generation requires a built version of makepng in the
18 echo "$0 [<directory>]"
19 echo ' Generate a set of PNG test files in "directory" ("tests" by default)'
26 echo "$0: the 'makepng' program must exist"
27 echo " in the directory within which this program:"
33 # Just one argument: the directory
39 test $# -eq 0 || usage
41 # Take care not to clobber something
44 test -d "$testdir" || usage
46 # mkdir -p isn't portable, so do the following
47 mkdir
"$testdir" 2>/dev
/null || mkdir
-p "$testdir" || usage
50 # This fails in a very satisfactory way if it's not accessible
54 echo "$testdir: directory not writable"
59 echo "$testdir: you have create but not write privileges here."
60 echo " This is unexpected. You have a spurion; "'"'"test$$.png"'"'"."
61 echo " You need to remove this yourself. Try a different directory."
65 # Now call makepng ($mp) to create every file we can think of with a
68 for gamma
in "" --sRGB --linear --1.8
82 "$mp" $gamma "$1" "$2" "test-$1-$2$gname.png"
86 for ct
in gray palette
96 for ct
in gray-alpha rgb rgb-alpha