# commands.log, run 2026-11-25 (UTC), ffmpeg 6.1.1-3ubuntu5, Python 3.12.3 published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh photos/landscape-3x2.jpg /tmp/work/out.png 1080 1350 wrote /tmp/work/out.png (1080x1350, whole photo kept, bars: white) exit=0 edge: test file: 3:2 photo into 1080x1350, whole photo kept published: python3 scan.py padded.png run: python3 scan.py /tmp/work/out.png 1080 1350 315 315 0 0 exit=0 edge: test file: bars counted on the padded result published: bash pad-photo.sh photo.jpg padded-black.png 1080 1350 black run: bash pad-photo.sh photos/landscape-3x2.jpg /tmp/work/black.png 1080 1350 black wrote /tmp/work/black.png (1080x1350, whole photo kept, bars: black) exit=0 edge: test file: black bars published: python3 scan.py padded-black.png 0 0 0 run: python3 scan.py /tmp/work/black.png 0 0 0 1080 1350 315 315 0 0 exit=0 edge: test file: black bars measured with the colour given published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh /tmp/work/nope.jpg /tmp/work/x.png 1080 1350 input not found: /tmp/work/nope.jpg exit=2 edge: a file that does not exist: exit 2 with a message published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh /tmp/work/empty.jpg /tmp/work/x.png 1080 1350 input is empty: /tmp/work/empty.jpg exit=2 edge: an empty file: exit 2 with a message published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh photos/landscape-3x2.jpg /tmp/work/x.png 10x80 1350 WIDTH and HEIGHT must be whole numbers exit=2 edge: a size that is not a number: exit 2 published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh photos/landscape-3x2.jpg /tmp/work/x.png 0 1350 WIDTH and HEIGHT must be above 0 exit=2 edge: a zero size: exit 2 published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh usage: pad-photo.sh input output WIDTH HEIGHT [COLOR] exit=2 edge: no arguments: usage line published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh photos/landscape-3x2.jpg /tmp/work/crlf.png 1080 1350 wrote /tmp/work/crlf.png (1080x1350, whole photo kept, bars: white) exit=0 edge: Windows line break on the sizes: still works published: python3 scan.py padded.png run: python3 scan.py /tmp/work/crlf.png 1080 1350 315 315 0 0 exit=0 edge: scan of the CRLF result published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh /tmp/work/фото панорама.jpg /tmp/work/результат.png 1080 1080 wrote /tmp/work/результат.png (1080x1080, whole photo kept, bars: white) exit=0 edge: non-ASCII file names and a panorama into a square published: python3 scan.py padded.png run: python3 scan.py /tmp/work/результат.png 1080 1080 386 387 0 0 exit=0 edge: scan of the non-ASCII result published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh /tmp/work/text.jpg /tmp/work/x.png 1080 1350 could not read an image from /tmp/work/text.jpg, or could not write /tmp/work/x.png (check the file type and the colour) exit=2 edge: a text file that is not an image: exit 2 with a message published: python3 scan.py padded.png run: python3 scan.py /tmp/work/nope.png image not found: /tmp/work/nope.png exit=2 edge: a missing file: exit 2 with a message published: python3 scan.py padded.png run: python3 scan.py /tmp/work/empty.png image is empty: /tmp/work/empty.png exit=2 edge: an empty file: exit 2 with a message published: python3 scan.py padded.png run: python3 scan.py /tmp/work/text.jpg could not read an image from: /tmp/work/text.jpg exit=2 edge: a text file that is not an image: exit 2 published: python3 scan.py padded.png run: python3 scan.py usage: scan.py image.png [R G B] exit=2 edge: no argument: usage line published: python3 scan.py padded-black.png 0 0 0 run: python3 scan.py /tmp/work/out.png 300 0 0 R G B must be whole numbers 0 to 255 exit=2 edge: a bad colour value (300): exit 2 published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh photos/landscape-16x9.jpg /tmp/work/fit.png 1920 1080 wrote /tmp/work/fit.png (1920x1080, whole photo kept, bars: white) exit=0 edge: a photo that already has the canvas shape: no bars published: python3 scan.py padded.png run: python3 scan.py /tmp/work/fit.png 1920 1080 0 0 0 0 exit=0 edge: scan of the no-bars result published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh photos/portrait-2x3.jpg /tmp/work/p1440.png 1080 1440 wrote /tmp/work/p1440.png (1080x1440, whole photo kept, bars: white) exit=0 edge: the published size as written: 2:3 portrait into 1080x1440, bars are 57 and 58 published: python3 scan.py padded.png run: python3 scan.py /tmp/work/p1440.png 1080 1440 0 0 57 58 exit=0 edge: scan of the 1080x1440 result: 57 left, 58 right published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh photos/panorama.jpg /tmp/work/pano566.png 1080 566 wrote /tmp/work/pano566.png (1080x566, whole photo kept, bars: white) exit=0 edge: panorama into 1080x566: bars are 129 and 130 published: python3 scan.py padded.png run: python3 scan.py /tmp/work/pano566.png 1080 566 129 130 0 0 exit=0 edge: scan of the 1080x566 result: 129 top, 130 bottom published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh /tmp/work/small.png /tmp/work/small-out.png 1080 1350 wrote /tmp/work/small-out.png (1080x1350, whole photo kept, bars: white) exit=0 edge: a photo smaller than the canvas (300x200) is scaled UP to 1080x720 published: python3 scan.py padded.png run: python3 scan.py /tmp/work/small-out.png 1080 1350 315 315 0 0 exit=0 edge: scan of the enlarged small photo: 315 and 315 published: bash pad-photo.sh photo.jpg padded.png 1080 1440 run: bash pad-photo.sh photos/landscape-3x2.jpg /tmp/work/o.jpg 1080 1350 wrote /tmp/work/o.jpg (1080x1350, whole photo kept, bars: white) exit=0 edge: a .jpg output: written, but compression changes the bar pixels published: python3 scan.py padded.png run: python3 scan.py /tmp/work/o.jpg 1080 1350 304 310 0 0 exit=0 edge: scan of the .jpg output gives wrong counts (png gives 315 315); scan.py needs a PNG