Upload image .

Found a bug? Tell us!!
Post Reply
carp3
Regular
Posts: 9
Joined: Tue Feb 07, 2006 9:18 am

Upload image .

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Upload image .

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
DwB
Regular
Posts: 32
Joined: Fri Feb 10, 2006 11:06 am
Contact:

Post 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);
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I want you to. :-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

As you wish.

It's committed; thanks for the patch!
Judebert
---
Website | Wishlist | PayPal
Post Reply