Page 1 of 1

Upload image .

Posted: Fri Apr 14, 2006 6:38 pm
by carp3
Hi
I have some probleme with creating thumbs

Code: Select all

Warning: imagejpeg(): Unable to access /home2/carp3co/public_html/uploads/av-11411.serendipityThumb.jpg in /home2/carp3co/public_html/include/functions_images.inc.php on line 1008

Warning: imagejpeg(): Invalid filename '/home2/carp3co/public_html/uploads/av-11411.serendipityThumb.jpg' in /home2/carp3co/public_html/include/functions_images.inc.php on line 1008

Serendipity 1.0-beta2
PHP 4.4.1
Linux
With PHP Safe mod ON

Re: Upload image .

Posted: Sat Apr 15, 2006 2:56 pm
by garvinhicking
Hi!

Creating thumbs is very problematic on machines with SafeMode. You need to make sure that PHP runs as the same user as the directories in which the original image is uploaded, and the owner of the file is the same as PHP.

The error message tells you, that this currently is not the case, so you might need to check with your provider. Usually, file system operations with SafeMode Cripple features are hard to get to work at all.

Regards,
Garvin

Posted: Fri Aug 25, 2006 11:02 pm
by DwB
I had the same problem. A view at the function imagejpeg() on php.net and there into the comments gave me the solution: just touch the file befpre creating it.

Find the following row within functions_images.inc.php (it's in the function serendipity_resize_image_gd() ):

$func['save']($out, $outfilename, $func['qual']);

and enter this line just before it:

touch($outfilename);

Posted: Mon Aug 28, 2006 10:23 pm
by judebert
This looks pretty straightforward. Garvin, I'm going to put it into the baseline. Update this thread if you want me not to.

Posted: Mon Aug 28, 2006 10:53 pm
by garvinhicking
Hi!

I want you to. :-)

Best regards,
Garvin

Posted: Tue Aug 29, 2006 1:57 pm
by judebert
As you wish.

It's committed; thanks for the patch!