Dear monks I am migrating to Apache2-mod_perl2 and I have a lot of problem while creating images.
First of all I am using GD for image creation/manipulation on the fly.
Secondly the module always worked with the previous version of the server but now it has some problem but not with all the images. Sometimes it doesn't create the image correctly and it saves an empty file. Sometimes there are no problems. Errors are always on the same images.
I checked the destination directory permissions in fact some images are generated as requested. The module seems to be correct because I called it inside a script with the same parameters and in this case there were no problems creating the image.
The errors occur both with and without TTF usage via stringFT so it seems to be something different from font writing. The error log doesn't tell me anything and I can't wonder why some image file is empty. I have checked the module with a log file and it seems that the problem could be connected with file saving operation.
Can somebody help me?
P.S. Here is the sub I use to save my images
#-------------------- sub save_img{ #-------------------- my ($image,$fileout,$type)=@_; unless($image){return(0,"no image object!!");} unless($fileout){return(0,"no file specified!!");} unless($type){$type="png";} open (IMAGO,">$fileout") or return(0,"error: $!"); binmode IMAGO; print IMAGO $image->$type; close IMAGO; return(1,"$fileout"); }

In reply to problem with GD image creation by parapara

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.