View previous topic :: View next topic |
Author |
Message |
geo__ Newbie
Joined: 26 Aug 2005 Posts: 7
|
Posted: Mon Aug 29, 2005 9:02 am Post subject: Could not save the output file './Thumbnails/test1_thumb.jpg |
|
|
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 |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Mon Aug 29, 2005 9:09 am Post subject: |
|
|
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 |
|
 |
geo__ Newbie
Joined: 26 Aug 2005 Posts: 7
|
Posted: Mon Aug 29, 2005 9:17 am Post subject: Tried it but Nothing |
|
|
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 |
|
 |
geo__ Newbie
Joined: 26 Aug 2005 Posts: 7
|
Posted: Mon Aug 29, 2005 9:25 am Post subject: |
|
|
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 |
|
 |
nation-x Newbie
Joined: 28 Aug 2005 Posts: 6
|
Posted: Mon Aug 29, 2005 8:37 pm Post subject: |
|
|
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 |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Tue Aug 30, 2005 3:43 am Post subject: |
|
|
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 |
|
 |
geo__ Newbie
Joined: 26 Aug 2005 Posts: 7
|
Posted: Tue Aug 30, 2005 6:32 am Post subject: Sucess at last! |
|
|
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 |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Tue Aug 30, 2005 6:51 am Post subject: |
|
|
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 |
|
 |
geo__ Newbie
Joined: 26 Aug 2005 Posts: 7
|
Posted: Tue Aug 30, 2005 6:55 am Post subject: |
|
|
I just noticed it b4 your reply and updated my message.
anyway thnx again. |
|
Back to top |
|
 |
|