Skip to content

Instantly share code, notes, and snippets.

@christian-blades-cb
Created November 15, 2024 18:45
Show Gist options
  • Save christian-blades-cb/df042c21e75eb32d5a7e896d46643f03 to your computer and use it in GitHub Desktop.
Save christian-blades-cb/df042c21e75eb32d5a7e896d46643f03 to your computer and use it in GitHub Desktop.
Convert PDF comics to CBZ
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p ghostscript -p imagemagick -p zip
set +xeu -o pipefail
bname=${1%.*}
cbzname=$bname.cbz
mkdir "$bname"
pushd "$bname"
magick -density 300 -quality 80 ../"$1" "Page-%04d.jpg"
popd
zip -r "$cbzname" "$bname"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment