Created
April 22, 2026 16:22
-
-
Save talwrii/08c45453759ebe8ff07fd06cbfc5e38e to your computer and use it in GitHub Desktop.
printimg — work around CUPS silently dropping progressive (interlaced) JPEGs by re-encoding to baseline before printing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # printimg - print any image, re-encoding JPEGs to baseline to dodge CUPS issues | |
| set -e | |
| if [ -z "$1" ]; then | |
| echo "Usage: printimg <image> [lpr options...]" >&2 | |
| exit 1 | |
| fi | |
| input="$1" | |
| shift | |
| tmp=$(mktemp --suffix=.jpg) | |
| trap 'rm -f "$tmp"' EXIT | |
| convert "$input" -interlace none "$tmp" | |
| lpr -o fit-to-page -o media=A4 "$@" "$tmp" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment