andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


Could not save the output file './Thumbnails/test1_thumb.jpg

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Drop Shadowed Thumbnail Creator
View previous topic :: View next topic  
Author Message
geo__
Newbie


Joined: 26 Aug 2005
Posts: 7

PostPosted: Mon Aug 29, 2005 9:02 am    Post subject: Could not save the output file './Thumbnails/test1_thumb.jpg Reply with quote

Hi,
I have this simple program:
<?php
require "class.dropshadow.php";
$ds = new dropShadow(true);
$ds->setShadowPath('./shadows/');
$ds->loadImage('./images/test1.jpg');
$ds->resizeByPercent(50, 0);
$ds->saveFinal("./Thumbnails/test1_thumb.jpg");
?>

Debug message from function resizeByPercent: Image size is 300 / 225

Debug message from function _saveImage: Could not save the output file './Thumbnails/test1_thumb.jpg' as a jpeg.

the directory Thumbnails is writable by everyone (666)
directory structure is
test
test/images
test/Thumbnails
test/shadows

Am I doing something wrong?

I just want to resize the image, not add a dropshadow.


Last edited by geo__ on Mon Aug 29, 2005 9:14 am; edited 1 time in total
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Mon Aug 29, 2005 9:09 am    Post subject: Reply with quote

It might be needing your full path. On the saveFinal call, try something like this:

$ds->saveFinal(dirname(__FILE__) . "/Thumbnails/test1_thumb.jpg");

Also, make sure that it's 'Thumbnails' and not 'thumbnails'.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
geo__
Newbie


Joined: 26 Aug 2005
Posts: 7

PostPosted: Mon Aug 29, 2005 9:17 am    Post subject: Tried it but Nothing Reply with quote

Tried the thing you suggested, but it didn't work.
the Case of the dirs is correct.

drwxr-xr-x 5 32038 sociale 4096 Aug 29 10:16 .
drwxr-xr-x 7 32038 sociale 4096 Aug 29 08:43 ..
drwxrw-rw- 2 32038 sociale 4096 Aug 29 08:44 Thumbnails
-rw-r--r-- 1 32038 sociale 18810 Aug 29 09:28 class.dropshadow.php
drwxr-xr-x 2 32038 sociale 4096 Aug 29 09:54 images
drwxrw-rw- 2 32038 sociale 4096 Aug 29 09:25 shadows
-rw-r--r-- 1 32038 sociale 352 Aug 29 10:16 test.dropshadow.php

ps: the showFinal works
Back to top
View user's profile Send private message
geo__
Newbie


Joined: 26 Aug 2005
Posts: 7

PostPosted: Mon Aug 29, 2005 9:25 am    Post subject: Reply with quote

plus I 've got another problem.
When I try this:
require "class.dropshadow.php";

$ds = new dropShadow(true);
$ds->setShadowPath('./shadows/');
$ds->loadImage('./images/test1.jpg');
$ds->resizeByPercent(50, 0);
$ds->applyShadow('CCCCCC');
$ds->showShadow('png');

I ge this:
Debug message from function resizeByPercent: Image size is 300 / 225

Debug message from function applyShadow: The shadow files could not be loaded.

Debug message from function _showImage: There is no processed image to show.
--------------
the shadow files are inside the shadows directory and are readable by everyone.
Back to top
View user's profile Send private message
nation-x
Newbie


Joined: 28 Aug 2005
Posts: 6

PostPosted: Mon Aug 29, 2005 8:37 pm    Post subject: Reply with quote

geo__ wrote:
plus I 've got another problem.
When I try this:
require "class.dropshadow.php";

$ds = new dropShadow(true);
$ds->setShadowPath('./shadows/');
$ds->loadImage('./images/test1.jpg');
$ds->resizeByPercent(50, 0);
$ds->applyShadow('CCCCCC');
$ds->showShadow('png');

I ge this:
Debug message from function resizeByPercent: Image size is 300 / 225

Debug message from function applyShadow: The shadow files could not be loaded.

Debug message from function _showImage: There is no processed image to show.
--------------
the shadow files are inside the shadows directory and are readable by everyone.


Another thing to consider is that your image is invalid or corrupt by GD standards.
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Tue Aug 30, 2005 3:43 am    Post subject: Reply with quote

nation-x wrote:
Another thing to consider is that your image is invalid or corrupt by GD standards.


Possible, but in this instance not the right answer...

Simply download all the shadow images on the website and pop them into the shadows directory. Make sure they're readable by the web server/php instance, and that should sort you out.

The reason it's giving the error about the 'no processed image' is because it's trying to show the drop-shadowed version of the image, but obviously this hasn't been created because it couldn't find all the shadow images.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
geo__
Newbie


Joined: 26 Aug 2005
Posts: 7

PostPosted: Tue Aug 30, 2005 6:32 am    Post subject: Sucess at last! Reply with quote

Andy thanks for your help.
After investigating further I noticed that the web server didn't have success to this directory.

Secondly, the "could not save jpeg" was due to the fact that I had the dir only rw by all, while it has to be rwx.


Last edited by geo__ on Tue Aug 30, 2005 6:53 am; edited 1 time in total
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Tue Aug 30, 2005 6:51 am    Post subject: Reply with quote

Ahh.. Didn't notice before, but your thumbnails and shadows directory don't have the exec bit set for groups/other. Now, you may very well be running the CGI version of PHP under your own username, or the web server runs under your username. But if not, and the webserver is actually a group or other than is trying to get access to those directories then it'll need the exec bit set.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
geo__
Newbie


Joined: 26 Aug 2005
Posts: 7

PostPosted: Tue Aug 30, 2005 6:55 am    Post subject: Reply with quote

I just noticed it b4 your reply and updated my message.
anyway thnx again.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Drop Shadowed Thumbnail Creator All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group