A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearPHP-GD imagejpeg unable to open - page 1
User InfoPosts
PHP-GD imagejpeg unable to open#1
When trying to save a thumbnail made with GD

imagejpeg($tnImage, "../../img/thumbs/".$maxWidth."x".$maxHeight."_".$filename);

I am getting the following error:

Warning: imagejpeg() [function.imagejpeg]: Unable to open (../../img/thumbs/80x80_55865-drops.jpg( for writing: No such file or directory in /home/user/workspace/stewart/server-side/libImg.php

/home/user/workspace/img/thumbs has its permissions set to 0x777.

What can be wrong here?

posted date: 2009-04-16 08:45:00

Re: PHP-GD imagejpeg unable to open#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-16 08:45:01

Re: PHP-GD imagejpeg unable to open#3
Where are you running the file from? If it(s from the server-side directory then I think you(re missing a "../"Try this:var_dump(realpath("../../img/thumbs/".$maxWidth."x".$maxHeight."_".$filename));

posted date: 2009-04-16 08:52:00

Re: PHP-GD imagejpeg unable to open#4
In /home/user/workspace/stewart/server-side/the directory../../img/thumbs/would equate to /home/user/workspace/img/thumbs/so you need ../../../img/thumbs/

posted date: 2009-04-16 08:54:00

Re: PHP-GD imagejpeg unable to open#5
var_dump(realpath("../../img/thumbs")); returns bool(false).

posted date: 2009-04-16 09:43:00

Re: PHP-GD imagejpeg unable to open#6
Sorry, made a mistake when writing the question: /home/user/workspace/img/thumbs has its permissions set to 0x777.

posted date: 2009-04-16 09:44:00

Re: PHP-GD imagejpeg unable to open#7
From php.net: realpath() returns FALSE on failure, e.g. if the file does not exist. Check the path, try with the absolute path maybe.

posted date: 2009-04-16 11:19:00

Re: PHP-GD imagejpeg unable to open#8
It can't find the file, but that shouldn't be a problem, because the imagejpeg function should create it if it doesn't exist. What version of GD are you using?

posted date: 2009-04-16 12:39:00

Re: PHP-GD imagejpeg unable to open#9
A workaround for this is providing the imagejpeg with the full path to the file. So you can have in config.php something likedefine((APPLICATION_PATH(, dirname(__FILE__));Then in your functions.php call imagejpeg like this:@imagejpeg($image, APPLICATION_PATH . (/uploads/myfile.jpg(, $quality);

posted date: 2012-02-20 08:39:00

Re: PHP-GD imagejpeg unable to open#10
I'm getting a false response on this: mydomain.com/wpdev/wp-content/uploads/bool(false). I have a feeling it's not saving my uploaded image to the server anywhere. I'll try doing just a straight upload instead of resizing for now and see what happens.

posted date: 2013-01-09 07:23:00

select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.