| 1 |
#!/usr/bin/perl |
| 2 |
# |
| 3 |
# Test reading PNG images |
| 4 |
# |
| 5 |
# Contributed by Bob Friesenhahn <[email protected]> |
| 6 |
# |
| 7 |
|
| 8 |
BEGIN { $| = 1; $test=1; print "1..6\n"; } |
| 9 |
END {print "not ok $test\n" unless $loaded;} |
| 10 |
use Image::Magick; |
| 11 |
$loaded=1; |
| 12 |
|
| 13 |
require 't/subroutines.pl'; |
| 14 |
|
| 15 |
chdir 't/png' || die 'Cd failed'; |
| 16 |
|
| 17 |
# |
| 18 |
# 1) Test Black-and-white, bit_depth=1 PNG |
| 19 |
# |
| 20 |
print( "1-bit grayscale PNG ...\n" ); |
| 21 |
testRead( 'input_bw.png', |
| 22 |
'7d12eaac6f41d3c2947022f382e158ea715e918ce0cd73649ec04db01239c88f' ); |
| 23 |
|
| 24 |
# |
| 25 |
# 2) Test Monochrome PNG |
| 26 |
# |
| 27 |
++$test; |
| 28 |
print( "8-bit grayscale PNG ...\n" ); |
| 29 |
testRead( 'input_mono.png', |
| 30 |
'fa43f8c3d45c3efadab6791a6de83b5a303f65e2c1d58e0814803a4846e68593' ); |
| 31 |
|
| 32 |
# |
| 33 |
# 3) Test 16-bit Portable Network Graphics |
| 34 |
# |
| 35 |
++$test; |
| 36 |
print( "16-bit grayscale PNG ...\n" ); |
| 37 |
testRead( 'input_16.png', |
| 38 |
'6418d8dd1206c3566bac92a883196d448b4d3cc7c19581d95d43bda4f0b7e495', |
| 39 |
'2d30a8bed1ae8bd19c8320e861f3140dfc7497ca8a05d249734ab41c71272f08' ); |
| 40 |
# |
| 41 |
# 4) Test 256 color pseudocolor PNG |
| 42 |
# |
| 43 |
++$test; |
| 44 |
print( "8-bit indexed-color PNG ...\n" ); |
| 45 |
testRead( 'input_256.png', |
| 46 |
'5798b9623e5922d3f6c0e87ae76ccc5a69568258e557613f20934f2de6ee2d35' ); |
| 47 |
|
| 48 |
# |
| 49 |
# 5) Test TrueColor PNG |
| 50 |
# |
| 51 |
++$test; |
| 52 |
print( "24-bit Truecolor PNG ...\n" ); |
| 53 |
testRead( 'input_truecolor.png', |
| 54 |
'eb9adaa26f3cda80273f436ddb92805da2cb88dd032d24380cd48cf05432a326' ); |
| 55 |
|
| 56 |
# |
| 57 |
# 6) Test Multiple-image Network Graphics |
| 58 |
# |
| 59 |
++$test; |
| 60 |
print( "MNG with 24-bit Truecolor PNGs...\n" ); |
| 61 |
testRead( 'input.mng', |
| 62 |
'65c0eacf6e060b9fb8467eaa0f74e2dcc3ef72d06577f06a506bd0546b01fb61' ); |
| 63 |
|