mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
script: confirm-matches-djpeg note truncated input
This commit is contained in:
1 parent
00d180ae74
commit
4f67db8842
1 file changed
+19
-8
@@ -63,15 +63,26 @@ fi
|
|||||||
result=0
|
result=0
|
||||||
|
|
||||||
handle() {
|
handle() {
|
||||||
local have=$(gen/bin/example-convert-to-nia -output-netpbm <$1 2>/dev/null | gen/bin/example-crc32)
|
|
||||||
local want=$($DJPEG_BINARY $1 2>/dev/null | gen/bin/example-crc32)
|
local want=$($DJPEG_BINARY $1 2>/dev/null | gen/bin/example-crc32)
|
||||||
if [ "$want" != "00000000" ]; then
|
if [ "$want" == "00000000" ]; then
|
||||||
if [ "$want" == "$have" ]; then
|
return
|
||||||
echo "Match $1"
|
fi
|
||||||
else
|
|
||||||
echo "Differ $1"
|
local have=$(gen/bin/example-convert-to-nia -output-netpbm <$1 2>/dev/null | gen/bin/example-crc32)
|
||||||
result=1
|
if [ "$want" == "$have" ]; then
|
||||||
fi
|
echo "Match $1"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Image file format specifications cover how to correctly decode complete
|
||||||
|
# input but usually do not mandate exactly how to decode truncated input.
|
||||||
|
# Print "trunc" vs "other" to distinguish these cases.
|
||||||
|
local error=$(gen/bin/example-convert-to-nia -output-netpbm <$1 2>&1 >/dev/null)
|
||||||
|
if [[ $error =~ :\ truncated.input$ ]]; then
|
||||||
|
echo "Differ (trunc) $1"
|
||||||
|
else
|
||||||
|
echo "Differ (other) $1"
|
||||||
|
result=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user