this script is perfect, thanks. but the tools depend on give me some trouble need iron out. i dont know how to leave a commt or what every on github, so i did this. wish can help other people.
error: insufficient image data in file
convert-im6.q16: insufficient image data in file `/home/peter/backup/Avatar_The_Last_Airbender_commic/pdf_total/operation/Avatar - The Last Airbender (08) - Imbalance Part 01 (2018) (digital) (Son of Ultron-Empire)/Avatar- The Last Airbender - Imbalance Part One-064.jpg' @ error/jpeg.c/ReadJPEGImage_/1166
path of debug
function: convert_file
in function convert_file try to print what cmd was executed, try to execute in bash
get output
convert-im6.q16: unable to open image `/home/peter/backup/Avatar_The_Last_Airbender_commic/pdf_total/operation/Avatar_The_Last_Airbender_02_The_Lost_Adventures/*.jpg': No such file or directory @ error/blob.c/OpenBlob/2924.
check the image file folder
-rw-rw-r-- 1 peter peter 0 Dec 1 2018 'Avatar- The Last Airbender - Imbalance Part One-052.jpg'
all *jpg have size of zero, guess the problem is the extract image part.
function: extract
same method try to echo execute command, see whats going on
for RAR, use 7z x
ERROR: Unsupported Method : Avatar- The Last Airbender - Imbalance Part One-070.jpg
serch for result:Failing to unrar files
truns out you need non-free 7z-rar module
sudo apt-get install -y p7zip-rar; # ubuntu 22.04, maybe different for other distro
now 7z x test run successfully output image. but new error is given.
convert-im6.q16: cache resources exhausted `/home/peter/backup/Avatar_The_Last_Airbender_commic/pdf_total/operation/Avatar - The Last Airbender - The Search Part 2 (2013) (digital) (Son of Ultron II-Empire)/Avatar - The Last Airbender - The Search Part 2-034.jpg' @ error/cache.c/OpenPixelCache/4095.
error: cache resources exhausted
ok, back to convert_file function
try to run
convert *.jpg -density 100 test.pdf
give same error
convert-im6.q16: cache resources exhausted `Avatar - The Last Airbender - The Search Part 3-034.jpg' @ error/cache.c/OpenPixelCache/4095.
find the solution cache resources exhausted Imagemagick
increate the cache size
try to find (ps i think is NOT nessarry)
sudo find / -name "policy.xml" 2>/dev/null
edit the (finded) configure file `/etc/ImageMagick-6/policy.xml`
change
<policy domain="resource" name="disk" value="1GiB"/>
to a bigger value
<policy domain="resource" name="disk" value="9091GiB"/>
try to exeute convert *.jpg -density 100 test.pdf
give a new error
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/421.
error: attempt to perform an operation not allowed by the security policy `PDF'
ImageMagick security policy 'PDF' blocking conversion
edit line like
<policy domain="coder" rights="none" pattern="PDF" />
to
<policy domain="coder" rights="read | write" pattern="PDF" />
test run, output normal pdf. everything work.
this script is perfect, thanks. but the tools depend on give me some trouble need iron out. i dont know how to leave a commt or what every on github, so i did this. wish can help other people.
error: insufficient image data in file
path of debug
function: convert_file
in function
convert_filetry to print what cmd was executed, try to execute in bashget output
check the image file folder
all
*jpghave size of zero, guess the problem is the extract image part.function: extract
same method try to echo execute command, see whats going on
for RAR, use
7z xserch for result:Failing to unrar files
truns out you need non-free 7z-rar module
now 7z x test run successfully output image. but new error is given.
error: cache resources exhausted
ok, back to
convert_filefunctiontry to run
convert *.jpg -density 100 test.pdfgive same error
find the solution cache resources exhausted Imagemagick
increate the cache size
try to find (ps i think is NOT nessarry)
edit the (finded) configure file
`/etc/ImageMagick-6/policy.xml`change
to a bigger value
try to exeute
convert *.jpg -density 100 test.pdfgive a new error
error: attempt to perform an operation not allowed by the security policy `PDF'
ImageMagick security policy 'PDF' blocking conversion
edit line like
to
test run, output normal pdf. everything work.