Problem composite huge images
Posted: 2011-02-03T04:13:57-07:00
Hey,
its my first contact with imagemagick so i think this problem is my fault.
Problem: I had to composite some huge images to one big one as a artwork master.
If the source images are not to big. Everything works fine.
But if they are to big (jpeg 12533x8333 ~7MB) imagemagick stops working with no result image.
I work with temp images in a folder on a webserver. After all i delete everything except the result PDF-File.
And now how i handle everything... inside a php-script
First step: create a new image
Second step: create another new image
Third step: open a huge source image and resize it -> at this point imagemagick stops often stops working and goes on with the next steps
Fourth step: Composite resized source-image with box-image
Sixth step: Composite box-source-image with page-image
Last step: Save it as pdf-File -> works mostly with no problems
So can anyone give me an solution how i can fix it and optimize my commands?
Thanks a lot
Greeting Bernd
its my first contact with imagemagick so i think this problem is my fault.
Problem: I had to composite some huge images to one big one as a artwork master.
If the source images are not to big. Everything works fine.
But if they are to big (jpeg 12533x8333 ~7MB) imagemagick stops working with no result image.
I work with temp images in a folder on a webserver. After all i delete everything except the result PDF-File.
And now how i handle everything... inside a php-script
First step: create a new image
Code: Select all
$page_path = $globalvar['filepathEditorTemp'].$product_id.'_page_'.$k_p.'.png';
$command = " convert -size ".$width_article."x".$height_article." -density ".$v_a->n_article_dpi."x".$v_a->n_article_dpi." xc:".$v_p->s_backColor." ".$page_path;
exec($command);
Code: Select all
$box_path = $globalvar['filepathEditorTemp'].$product_id.'_box_'.$k_b.'.png';
$command = "convert -size ".$width."x".$height." -density ".$v_a->n_article_dpi."x".$v_a->n_article_dpi." xc:".$v_b->s_backColor." ".$box_path;
exec($command);
Code: Select all
$trans_path = $globalvar['filepathEditorTemp'].$product_id.'_trans_'.$k_b.'.png';
$command = "convert -geometry ".$t_width."x".$t_height." -density ".$v_a->n_article_dpi."x".$v_a->n_article_dpi." ".$source_image." ".$trans_path;
exec($command);
Code: Select all
$command = "composite -geometry ".$t_left.$t_top." ".$trans_path." ".$box_path." ".$box_path;
exec($command);
Code: Select all
$command = "composite -geometry ".$left.$top." ".$box_path." ".$page_path." ".$page_path;
exec($command);
Code: Select all
$command = "composite -geometry ".$left.$top." ".$box_path." ".$page_path." ".$page_path;
exec($command);
Thanks a lot
Greeting Bernd