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");
}