Skip to content

Commit

Permalink
replace deprecated 'convert' with 'magick' in compress-scan
Browse files Browse the repository at this point in the history
  • Loading branch information
gzagatti committed Dec 4, 2024
1 parent 434fdd8 commit bfc321e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/compress-scan
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ display_help() {
echo "Examples:"
echo " $0 input.pdf output.pdf"
echo " $0 input.pdf output.pdf -resize 25% -quality 60"
echo
echo " # A4 portrait"
echo " $0 input.pdf output.pdf -resize 794x1123\> -density 96"
echo " $0 input.pdf output.pdf -resize 595x842\> -density 72"
}

# check if no arguments or -h/--help is provided
Expand Down Expand Up @@ -42,11 +46,11 @@ pdfimages -j "$input_pdf" "$temp_dir/extracted_image"

# process images with the remaining arguments
for img in "$temp_dir"/extracted_image*.jpg; do
convert "$@" "$img" "${img%.jpg}_small.jpg"
magick "$img" "$@" "${img%.jpg}_small.jpg"
done

# convert images back to PDF
convert $(ls "$temp_dir"/*small.jpg | sort -V) "$output_pdf"
magick $(ls "$temp_dir"/*small.jpg | sort -V) "$output_pdf"

# clean up
rm -r "$temp_dir"
Expand Down

0 comments on commit bfc321e

Please sign in to comment.