diff options
author | Soispha <soispha@vhack.eu> | 2023-12-30 10:27:13 +0100 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-12-30 10:27:13 +0100 |
commit | c35ede7a2c46606ad422ef1018b69338a68f0081 (patch) | |
tree | ce65fa51a8fd322c8a49bc6771452c230ebd18d2 /hm | |
parent | fix(hm/pkgs/con2pdf): Allow for multiple pages on adf (diff) | |
download | nixos-config-c35ede7a2c46606ad422ef1018b69338a68f0081.tar.gz nixos-config-c35ede7a2c46606ad422ef1018b69338a68f0081.zip |
docs(hm/pkgs/con2pdf): Add dbg statements
Diffstat (limited to '')
-rw-r--r-- | hm/soispha/pkgs/scripts/apps/con2pdf | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hm/soispha/pkgs/scripts/apps/con2pdf b/hm/soispha/pkgs/scripts/apps/con2pdf index 4a45250e..f0942a5c 100644 --- a/hm/soispha/pkgs/scripts/apps/con2pdf +++ b/hm/soispha/pkgs/scripts/apps/con2pdf @@ -84,9 +84,11 @@ process_images_adf() { pdf_counter=0; image_cache="$(mktmp)" while read -r scanned_image; do + dbg "$scanned_image (scanned_image) at $counter (counter)"; echo "$scanned_image" >> "$image_cache" : $((counter += 1)) if [ "$counter" = "$number_of_pages" ]; then + dbg "$counter == $number_of_pages" counter=0; convert_images_flatbed "$image_cache" "${name}_$pdf_counter" "$output_directory" : $((pdf_counter += 1)) @@ -133,13 +135,14 @@ convert_images_flatbed() { set -- while read -r image; do + dbg "setting image: $image"; set -- "$@" "$image" done < "$image_cache" while [ -e "$output_dir/${name}.pdf" ]; do name="${name}_$(tr -dc 'A-Za-z0-9' </dev/urandom | head -c 25)" done - + dbg "using name: $name"; convert "$@" -compress jpeg -quality 100 "$output_dir/${name}.pdf" } |