1#!/bin/sh 2# Swaps the byte order of test EXIF files and ensures the data don't change. 3srcdir="${srcdir:-.}" 4TMPLOG="$(mktemp)" 5trap 'rm -f "${TMPLOG}"' 0 6 7. ${srcdir}/inc-comparetool.sh 8 9# Ensure that names are untranslated 10LANG= 11LANGUAGE= 12LC_ALL=C 13export LANG LANGUAGE LC_ALL 14for fn in "${srcdir}"/testdata/*.jpg ; do 15 # The *.parsed text files have LF line endings, so the tr removes 16 # the CR from CRLF line endings, while keeping LF line endings the 17 # same. 18 ./test-parse$EXEEXT --swap-byte-order "${fn}" | tr -d '\015' | sed -e '/^New byte order:/d' > "${TMPLOG}" 19 if ${comparetool} "${fn}.parsed" "${TMPLOG}"; then 20 : "no differences detected" 21 else 22 echo Error parsing "$fn" 23 exit 1 24 fi 25done 26