[BlueOnyx:19878] Re: GD image problem

fastreplies fastreplies at shaw.ca
Sun Jul 24 18:09:40 -05 2016


Thanks Michael,

One problem has been solved but... one more to go

to make it short, we allow people to submit their banner or image using our 
directory submission form and even thou we tell them what size to submit... 
well, they submit whatever they want.

So, we use .cgi script that resizes image to proper size and that script too 
stop working now.
---------------------
eval 'use Image::Magick;';
if ($@ ne "") { $IM = "false"; } else { $IM = "true"; }
eval 'use Image::Resize;';
if ($@ ne "") { $IMRES = "false"; } else { $IMRES = "true"; }
---------------------------

### CONFIGURE WHAT TO USE FOR IMAGE RESIZING
if ((-e "$data_dir/imgresconf.dat") < 1)
{
if (($IM eq "true") and ($IMRES eq "false")) ### IMAGE MAGICK
{
open (DDT, "> $data_dir/imgresconf.dat");
print DDT "IM";
close (DDT);
}
elsif (($IM eq "false") and ($IMRES eq "true")) ### IMAGE RESIZE MODULE
{
open (DDT, "> $data_dir/imgresconf.dat");
print DDT "IMRES";
close (DDT);
}
else ### IF BOTH MODS INSTALLED USE image::resize
{
open (DDT, "> $data_dir/imgresconf.dat");
print DDT "IMRES";
close (DDT);
}
}

--------------------------

Any idea? :)
Cheers
Bart

----- Original Message ----- 
From: "Michael Stauber" <mstauber at blueonyx.it>
To: "BlueOnyx General Mailing List" <blueonyx at mail.blueonyx.it>
Sent: Sunday, July 24, 2016 5:05 PM
Subject: [BlueOnyx:19877] Re: GD image problem


> Hi Bart,
>
>> imagejpeg ($im,'',80);
>
> This last line in your gd.php is the problem. When I tried that code on
> a 5209R of mine I got this error message in /var/log/httpd/error_log:
>
> [Sun Jul 24 17:00:41.566263 2016] [proxy_fcgi:error] [pid 21758] [client
> 181.140.32.231:53482] AH01071: Got error 'PHP message: PHP Warning:
> imagejpeg(): Filename cannot be empty in /home/.sites/28/site1/web/gd.php'
>
> See: http://php.net/manual/en/function.imagejpeg.php
>
> So you need to change this ...
>
> imagejpeg ($im,'',80);
>
> ... to this ...
>
> imagejpeg ($im);
>
> ... and it'll work.
>
> -- 
> With best regards
>
> Michael Stauber
> _______________________________________________
> Blueonyx mailing list
> Blueonyx at mail.blueonyx.it
> http://mail.blueonyx.it/mailman/listinfo/blueonyx 





More information about the Blueonyx mailing list