Page 1 of 1

[CLOSE]Optimise Convert

Posted: 2014-11-07T04:00:48-07:00
by mvs
Hello,

I have some PDG with ~100 pages to convert on 3 differents size JPG, my server take 1h30-2h to create the picture.

I have three command to done this :

C:\ImageMagick\convert.exe -limit memory 12GiB -limit map 12GiB -density 300 c:\1.pdf -resize 200x266 -interlace none -density 72 -quality 80 c:\jpg\200_266_page.jpg"
C:\ImageMagick\convert.exe -limit memory 12GiB -limit map 12GiB -density 300 c:\1.pdf -resize 1536x2048 -interlace none -density 72 -quality 80 c:\jpg\1536_2048_page.jpg"
C:\ImageMagick\convert.exe -limit memory 12GiB -limit map 12GiB -density 300 c:\1.pdf -resize 2048x2730 -interlace none -density 72 -quality 80 c:\jpg\2048_2730_page.jpg"

This commands are called by a script php with the command exec.

The limit memory and map seems don't work

Do you an idea to help me to optimize my job

Thanks a lot

Re: Optimise Convert

Posted: 2014-11-07T04:27:12-07:00
by snibgo
You are rasterizing the same PDF three times. This can be done just once. Windows BAT syntax:

Code: Select all

C:\ImageMagick\convert.exe ^
  -limit memory 12GiB -limit map 12GiB -density 300 ^
  c:\1.pdf ^
  -interlace none -density 72 -quality 80 ^
  ( -clone 0--1 -resize 200x266 -write c:\jpg\200_266_page.jpg" -delete 0--1 ) ^
  ( -clone 0--1 -resize 1536x2048 -write c:\jpg\1536_2048_page.jpg" -delete 0--1 ) ^
  -resize 2048x2730 c:\jpg\2048_2730_page.jpg"

Re: Optimise Convert

Posted: 2014-11-07T06:32:49-07:00
by mvs
thanks for your replay

It seems faster with a 10 page PDf but I have an error message with the last line :

Code: Select all

C:\ImageMagick\convert.exe -limit memory 12GiB -limit map 12GiB -density 300 "E:/www/test_img/4/1_pdfsam_B175_fusion-tablette-150dpi.pdf" -interlace none -density 72 -quality 80 ^ ( -clone 0--1 -resize 200x266 -write E:/www/test_img/4/jpg/200_266_page.jpg ^
 ( -clone 0--1 -resize 1536x2048 -write E:/www/test_img/4/jpg/1536_2048_page.jpg ^
-resize 2048x2730 E:/www/test_img/4/jpg/2048_2730_page.jpg
Error Message :

Code: Select all

convert.exe: unbalanced parenthesis 'E:/www/test_img/4/jpg/2048_2730_page.jpg'
@ error/convert.c/ConvertImageCommande/3039
Do you have an idea ?

Thanks a lot


Edit :

Ok i erase the end of the line clone...

It's ok now

Code: Select all

C:\ImageMagick\convert.exe -limit memory 12GiB -limit map 12GiB -density 300 "E:/www/test_img/4/1_pdfsam_B175_fusion-tablette-150dpi.pdf" -interlace none -density 72 -quality 80 ^ ( -clone 0--1 -resize 200x266 -write E:/www/test_img/4/jpg/200_266_page.jpg -delete 0--1 ) ^
 ( -clone 0--1 -resize 1536x2048 -write E:/www/test_img/4/jpg/1536_2048_page.jpg -delete 0--1 ) ^
-resize 2048x2730 E:/www/test_img/4/jpg/2048_2730_page.jpg
Thanks you for your help I'll try on my server

Re: Optimise Convert

Posted: 2014-11-07T08:51:01-07:00
by mvs
Il very slow so i'll try another way and it's succed. I make 5 jpg by page in 10min

For that i make my treatment page by page with a while in php and it will be very faster!!

If that post can help someone !!

Re: [CLOSE]Optimise Convert

Posted: 2014-11-07T08:55:51-07:00
by snibgo
On a 94-page A4 PDF, my command on my laptop (Windows 8.1) takes 1m54s, roughly 1 page per second. I don't know why yours is much slower.