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.


Overwrite an image

 
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
itamar
Newbie


Joined: 04 Aug 2004
Posts: 5

PostPosted: Wed Aug 04, 2004 9:03 pm    Post subject: Overwrite an image Reply with quote

Hey,

I'm trying to overwrite exsiting thumbnails, but it's not working.

$ds->saveShadow('./images/test.jpg', 'jpg', 90)
$ds->saveFinal('./images/test.jpg', 'jpg',90);

if I will change the saveFinal image that will work.
But I really want to overwrite the file and not handling more temp files.

Thanks,
Itamar.
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Thu Aug 05, 2004 1:40 am    Post subject: Reply with quote

Hi, and welcome to the board.

You shouldn't use both save functions, it's only one or the other. The 'final' is used to save the image that you have resized, before showing gets applied. The 'shadow' save is there to save the thumbnail once you've applied a shadow effect to it. What your code will do is ave the shadow image to the server and then save the plain resized version right over the top of the shadow version, over-writing it. If you want to save the resized and the shadowed versions then you have to use different file names (this is the same for any file system out there).

If I've misunderstood your intentions, then post up a bit more of an explaination of what you're trying to accomplish.

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


Joined: 04 Aug 2004
Posts: 5

PostPosted: Thu Aug 05, 2004 3:05 am    Post subject: Thank you, Reply with quote

you understand exactly.... and your answer solved 2 days of working around.

It's like magic now...
Thanks again for creating this great handy tool. Very Happy Very Happy Very Happy

Itamar.
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Thu Aug 05, 2004 4:45 am    Post subject: Reply with quote

No probs - glad it now works as you'd expect! Smile

I have to admit that the whole final/shadow thing is confusing, and I plan to do something about it in the next version. (Maybe store a chain of events in an array, so you can save out any step of that chain, from the original image to the latest version of it... Kind of like the history function in PhotoShop, I guess.)

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


Joined: 04 Aug 2004
Posts: 5

PostPosted: Thu Aug 05, 2004 11:48 am    Post subject: Future Ver. I can't wait... Reply with quote

I wanted to ask you one more qus.
I have problems with uploading .Png files, Jpgs works fine.
(I'm using GD2.0.0x)

require ("drop_shadow/class.dropshadow.php");
$ds = new dropShadow(FALSE);
$ds->setShadowPath('drop_shadow/shadows/');
$ds->loadImage($thumb);
$ds->applyShadow('FFFFFF');
$ds->saveShadow($thumb);

Do I need to do something else for Pnjs?
Itamar.
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