test: GPS check commands, ffmpeg 6.1.1-3ubuntu5, ffprobe 6.1.1-3ubuntu5, python 3.12.3, 2026-11-24 published: python3 gps-check.py photo.jpg command as run: python3 -I gps-check.py files/1-gps-exif.jpg (main: JPEG with Exif GPS) exit=1 edge: case run: main: JPEG with Exif GPS output: files/1-gps-exif.jpg: GPS FOUND, Exif GPS 44.1194, 15.2314 published: python3 gps-check.py photo.jpg command as run: python3 -I gps-check.py files/2-gps-xmp-only.jpg (edge: GPS only in XMP) exit=1 edge: case run: GPS only in XMP output: files/2-gps-xmp-only.jpg: GPS FOUND, XMP GPS 44,7.164N, 15,13.884E published: python3 gps-check.py photo.jpg command as run: python3 -I gps-check.py edge/empty.jpg (edge: empty file) exit=2 edge: case run: empty file output: edge/empty.jpg: cannot read (file is empty) published: python3 gps-check.py photo.jpg command as run: python3 -I gps-check.py edge/missing.jpg (edge: missing file) exit=2 edge: case run: missing file output: edge/missing.jpg: cannot read ([Errno 2] No such file or directory: 'edge/missing.jpg') published: python3 gps-check.py photo.jpg command as run: python3 -I gps-check.py files/5-gps-exif.png (edge: PNG with eXIf GPS) exit=1 edge: case run: PNG with eXIf GPS output: files/5-gps-exif.png: GPS FOUND, Exif GPS 44.1194, 15.2314 edge: gps-check exits 0 (no GPS), 1 (GPS found), 2 (cannot read); the empty and missing files exit 2, not 0 published: ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 photo.jpg | grep -ci gps command as run: bash -c ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 files/1-gps-exif.jpg | grep -ci gps (main: JPEG with Exif GPS) exit=0 edge: case run: main: JPEG with Exif GPS output: 5 published: ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 photo.jpg | grep -ci gps command as run: bash -c ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 files/2-gps-xmp-only.jpg | grep -ci gps (edge: GPS only in XMP) exit=1 edge: case run: GPS only in XMP output: 0 published: ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 photo.jpg | grep -ci gps command as run: bash -c ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 files/5-gps-exif.png | grep -ci gps (edge: PNG with eXIf GPS) exit=1 edge: case run: PNG with eXIf GPS output: 0 edge: ffprobe printed 0 GPS tags for the XMP-only JPEG and for the PNG although both carry coordinates (gps-check finds them); grep -c exits 1 when it counts 0 published: ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 photo.jpg | grep -ci gps command as run: bash -c ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 edge/empty.jpg | grep -ci gps (edge: empty file) exit=1 edge: case run: empty file output: edge/empty.jpg: Invalid data found when processing input output: 0 published: ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 photo.jpg | grep -ci gps command as run: bash -c ffprobe -v error -show_frames -show_entries frame_tags -of default=nw=1 edge/missing.jpg | grep -ci gps (edge: missing file) exit=1 edge: case run: missing file output: edge/missing.jpg: No such file or directory output: 0 edge: the same ffprobe pipe prints 0 for an empty and a missing file (the read error goes to stderr, not into the count), so 0 can also mean the file could not be read; gps-check.py exits 2 for both published: ffmpeg -i photo.jpg -c copy copy.jpg command as run: ffmpeg -v error -y -i files/1-gps-exif.jpg -c copy ctl/copy.jpg (main: control, JPEG with Exif GPS) exit=0 edge: case run: main: control, JPEG with Exif GPS output: published: python3 gps-check.py copy.jpg command as run: python3 -I gps-check.py ctl/copy.jpg (check of the control output) exit=1 edge: case run: check of the control output output: ctl/copy.jpg: GPS FOUND, Exif GPS 44.1194, 15.2314 published: ffmpeg -i photo.jpg -q:v 3 reencoded.jpg command as run: ffmpeg -v error -y -i files/1-gps-exif.jpg -q:v 3 ctl/same-size-reencode.jpg (main: same-size re-encode) exit=0 edge: case run: main: same-size re-encode output: published: python3 gps-check.py reencoded.jpg command as run: python3 -I gps-check.py ctl/same-size-reencode.jpg (check of the re-encode output) exit=0 edge: case run: check of the re-encode output output: ctl/same-size-reencode.jpg: no GPS found published: ffmpeg -i photo.png -c copy copy.png command as run: ffmpeg -v error -y -i files/5-gps-exif.png -c copy ctl/copy.png (edge: PNG with eXIf GPS, stream copy) exit=0 edge: case run: PNG with eXIf GPS, stream copy output: published: python3 gps-check.py copy.png command as run: python3 -I gps-check.py ctl/copy.png (edge: check of the PNG copy) exit=1 edge: case run: check of the PNG copy output: ctl/copy.png: GPS FOUND, Exif GPS 44.1194, 15.2314 published: ffmpeg -i photo.png reencoded.png command as run: ffmpeg -v error -y -i files/5-gps-exif.png ctl/reencoded.png (edge: PNG with eXIf GPS, re-encode) exit=0 edge: case run: PNG with eXIf GPS, re-encode output: published: python3 gps-check.py reencoded.png command as run: python3 -I gps-check.py ctl/reencoded.png (edge: check of the PNG re-encode) exit=0 edge: case run: check of the PNG re-encode output: ctl/reencoded.png: no GPS found