The pdf file size is typically between 3MB-12MB and contains 15-25 pages of 8.5"X11" scanned documents at 300dpi.
The convert commands works for the first three pdf documents and then every file after that it keeps dropping the last few pages and the last jpg image it generates is black.
Further, investigation reveals an error code of "Last OS error: 28" with the full error looking like:
Code: Select all
ERROR: /ioerror in --.outputpage-- Operand stack: 1 true Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- 21 1 20 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval-- 0 9 %oparray_pop --nostringval-- --nostringval-- Dictionary stack: --dict:1128/1686(ro)(G)-- --dict:0/20(G)-- --dict:107/200(L)-- --dict:107/200(L)-- --dict:104/127(ro)(G)-- --dict:241/347(ro)(G)-- --dict:20/24(L)-- --dict:4/6(L)-- --dict:21/32(L)-- Current allocation mode is local Last OS error: 28 Last OS error: 28
My webserver says it has this much tmp space available to Imagemagick:
Code: Select all
AREA = 12kb
MEMORY = 7.9gb
MAP = 5.9gb
DISK = 32gb4eb
How can i set what tmp directory Imagemagick uses? Is there a command i can use? Or is that only something the webserver administrators: my webhost can set and they are basically telling me to buzz-off? Plus, if my user account was only given 20,000mb won't that make the situation worse instead of better?
The convert command i am using to do the pdf->jpg is:
Code: Select all
$cmd = 'convert -limit memory 1024 -limit map 4096 -density 300x300 -define pdf:use-cropbox=true ' . $pdf_file . ' -resize 35% -quality 100 ' . $jpgloc;
$status=exec($cmd);