]> granicus.if.org Git - imagemagick/blob - tests/validate-pipe.sh
(no commit message)
[imagemagick] / tests / validate-pipe.sh
1 #!/bin/sh
2 #
3 #  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
4 #  dedicated to making software imaging solutions freely available.
5 #
6 #  You may not use this file except in compliance with the License.  You may
7 #  obtain a copy of the License at
8 #
9 #    http://www.imagemagick.org/script/license.php
10 #
11 #  Unless required by applicable law or agreed to in writing, software
12 #  distributed under the License is distributed on an "AS IS" BASIS,
13 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #  See the License for the specific language governing permissions and
15 #  limitations under the License.
16 #
17 #  Test for 'validate' utility.
18 #
19 set -e # Exit on any error
20 [ "X$srcdir" = "X" ] && srcdir=`pwd`
21 . ${srcdir}/tests/common.sh
22
23 ${MAGICK} pnm:- null:   < ${REFERENCE_IMAGE}
24 ${MAGICK} pnm:- info:   < ${REFERENCE_IMAGE}
25 ${MAGICK} pnm:- miff:-  < ${REFERENCE_IMAGE} | ${IDENTIFY} -
26 ${MAGICK} pnm:- -       < ${REFERENCE_IMAGE} | ${IDENTIFY} -
27 ${MAGICK} ${REFERENCE_IMAGE} -write null:  null:
28 ${MAGICK} ${REFERENCE_IMAGE} -write info:  null:
29 ${MAGICK} ${REFERENCE_IMAGE} -write miff:- null: | ${IDENTIFY} -
30 ${MAGICK} ${REFERENCE_IMAGE} -write -      null: | ${IDENTIFY} -
31
32 # IMv7 "magick" testing
33
34 # -exit can be used insted of implicit write
35 ${MAGICK} ${REFERENCE_IMAGE} -write info: -exit
36 # null: does not require an image during write
37 ${MAGICK} -write null: -exit
38 ${MAGICK} ${REFERENCE_IMAGE} -write info: +delete null:
39 # Using file decriptors (write)
40 ${MAGICK} ${REFERENCE_IMAGE} fd:6  6>&1 | ${IDENTIFY} -
41 # Using file decriptors (read)
42 exec 5<${REFERENCE_IMAGE}
43 ${MAGICK} fd:5 info:
44 exec 5<&-
45 # pipelined magick script
46 echo "-read ${REFERENCE_IMAGE} -write info:" | ${MAGICK} -script -
47 # pipelined magick script, input image pre-read
48 echo "-write info:" | ${MAGICK} ${REFERENCE_IMAGE} -script -
49 # pipelined script from file descriptor, read image from stdin
50 echo "-read pnm:- -write info:" |\
51    ${MAGICK} -script fd:5 5<&0 <${REFERENCE_IMAGE}
52