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