Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AOMediaCodec/libavif
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0d272638f530a9e7ed5d6037ec4f92a972a6ae0e
Choose a base ref
..
head repository: AOMediaCodec/libavif
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 95888a698283282132e14d615dcd38fbb8d3b3c6
Choose a head ref
Showing with 5 additions and 12 deletions.
  1. +5 −12 tests/test_cmd_stdin.sh
17 changes: 5 additions & 12 deletions tests/test_cmd_stdin.sh
Original file line number Diff line number Diff line change
@@ -35,18 +35,11 @@ strip_header_if() {
STRIP_HEADER="$2"

if ${STRIP_HEADER}; then
# grep -V && echo "success"
# grep mdat "${FILE}" && echo "success"
# grep --text mdat "${FILE}" && echo "success"
# grep --text --max-count=1 mdat "${FILE}" && echo "success"
# grep --text --max-count=1 --byte-offset mdat "${FILE}" && echo "success"
# grep --text --max-count=1 --byte-offset --only-matching mdat "${FILE}" && echo "success"
# grep --text --max-count=1 --byte-offset --only-matching --binary mdat "${FILE}" && echo "success"
# grep -o -b -a mdat "${FILE}"
# MDAT_OFFSET=$(grep -o -b -a mdat "${FILE}" | cut -f1 -d:)
awk -V && echo "success"
awk --help && echo "success"
MDAT_OFFSET=$(awk -b -v RS='mdat' '{print length($0); exit}' "${FILE}")
# The following does not work on all platforms:
# grep --text mdat "${FILE}"
# awk -b -v RS='mdat' '{print length($0); exit}' "${FILE}"
# Hence the hardcoded variable below.
MDAT_OFFSET=1061
FILE_CONTENTS_AFTER_HEADER=$(tail -c +${MDAT_OFFSET} < "${FILE}")
echo "${FILE_CONTENTS_AFTER_HEADER}" > "${FILE}"
fi