cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | #!/usr/bin/perl |
Cristy | 7ce65e7 | 2015-12-12 18:03:16 -0500 | [diff] [blame] | 2 | # Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3 | # dedicated to making software imaging solutions freely available. |
| 4 | # |
| 5 | # You may not use this file except in compliance with the License. You may |
| 6 | # obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.imagemagick.org/script/license.php |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | # Test getting attributes. |
| 17 | # |
| 18 | BEGIN { $| = 1; $test=1, print "1..25\n"; } |
| 19 | END {print "not ok 1\n" unless $loaded;} |
| 20 | use Image::Magick; |
| 21 | $loaded=1; |
| 22 | |
| 23 | require 't/subroutines.pl'; |
| 24 | |
| 25 | chdir 't' || die 'Cd failed'; |
| 26 | |
| 27 | testGetAttribute('input.miff','base-columns','70'); |
| 28 | |
| 29 | ++$test; |
| 30 | testGetAttribute('input.miff','base-filename','input.miff'); |
| 31 | |
| 32 | ++$test; |
| 33 | testGetAttribute('input.miff','base-rows','46'); |
| 34 | |
| 35 | ++$test; |
| 36 | testGetAttribute('input.miff','class','DirectClass'); |
| 37 | |
| 38 | ++$test; |
| 39 | testGetAttribute('input.miff','colors','3019'); |
| 40 | |
| 41 | ++$test; |
| 42 | testGetAttribute('input.miff','columns','70'); |
| 43 | |
| 44 | ++$test; |
| 45 | testGetAttribute('input.miff','directory',undef); |
| 46 | |
| 47 | ++$test; |
cristy | 1214288 | 2012-06-17 00:52:29 +0000 | [diff] [blame] | 48 | testGetAttribute('input.miff','gamma','0.454545'); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 49 | |
| 50 | ++$test; |
| 51 | testGetAttribute('input.miff','geometry',undef); |
| 52 | |
| 53 | ++$test; |
| 54 | testGetAttribute('input.miff','height','46'); |
| 55 | |
| 56 | ++$test; |
| 57 | # Returns undef |
| 58 | testGetAttribute('input.miff','label',undef); |
| 59 | |
| 60 | ++$test; |
| 61 | testGetAttribute('input.miff','matte','0'); |
| 62 | |
| 63 | ++$test; |
| 64 | testGetAttribute('input.miff','error','0'); |
| 65 | |
| 66 | ++$test; |
| 67 | testGetAttribute('input.miff','montage',undef); |
| 68 | |
| 69 | ++$test; |
| 70 | testGetAttribute('input.miff','maximum-error','0'); |
| 71 | |
| 72 | ++$test; |
| 73 | testGetAttribute('input.miff','mean-error','0'); |
| 74 | |
| 75 | ++$test; |
| 76 | testGetAttribute('input.miff','rows','46'); |
| 77 | |
| 78 | ++$test; |
| 79 | testGetAttribute('input.miff','signature', |
cristy | 4e285b9 | 2013-05-24 17:42:57 +0000 | [diff] [blame] | 80 | 'f7b3db46d6f696ea8392f0ad0be945dd502a806e2c1e9c082efef517191758f7'); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 81 | |
| 82 | ++$test; |
| 83 | testGetAttribute('input.miff','texture',undef); |
| 84 | |
| 85 | ++$test; |
| 86 | testGetAttribute('input.miff','type','TrueColor'); |
| 87 | |
| 88 | ++$test; |
| 89 | testGetAttribute('input.miff','units','undefined units'); |
| 90 | |
| 91 | ++$test; |
| 92 | testGetAttribute('input.miff','view',undef); |
| 93 | |
| 94 | ++$test; |
| 95 | testGetAttribute('input.miff','width','70'); |
| 96 | |
| 97 | ++$test; |
| 98 | testGetAttribute('input.miff','x-resolution','72'); |
| 99 | |
| 100 | ++$test; |
| 101 | testGetAttribute('input.miff','y-resolution','72'); |
| 102 | |
| 103 | 1; |