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.


I made a slight change to the resizeToSize function.

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


Joined: 12 Oct 2004
Posts: 10
Location: Atlanta, GA

PostPosted: Tue Oct 12, 2004 11:45 am    Post subject: I made a slight change to the resizeToSize function. Reply with quote

Greetings from Atlanta, GA. Laughing I have incorporated your dropshadow class into my photo album on my web site. The photo album is written in ASP but I call a php script which uses the dropshadow class functions. I needed to make thumbnails on the fly and also wanted the drop shadow on the larger views of the photos. The width of the larger photos is 540px. The problem was that some of my pics are smaller than that and if I enlarge them to 540 they would become slightly distorted or fuzzy. So, I modified the resizeToSize function to change the size only if the original pic was larger then the new size. The following is my new version of the function:

function resizeToSize($x, $y)
{
$ix = ImageSX($this->_imgOrig);
$iy = ImageSY($this->_imgOrig);
$nx = $x;
$ny = $y;
if($ix < $x) $nx = $ix;
if($iy < $y) $ny = $iy;
if ($x == 0) list($nx, $ny) = $this->_getProportionalSize(0, $ny);
if ($y == 0) list($nx, $ny) = $this->_getProportionalSize($nx, 0);
$this->_debug('resizeToSize', "Image size is $nx / $ny");
return ($this->_resizeImage($nx, $ny, 'resizeToSize'));
}

I hope you don't mind me taking the liberty of changing your code. My photo album is located at
http://www.gaclarke.com/gallery/
Thanks and happy coding.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
amnuts
Site Admin


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

PostPosted: Wed Oct 13, 2004 7:21 am    Post subject: Reply with quote

Hi, and welcome to the board!

It's totally fine if you want to update the code for your own uses! If I didn't want people to get the code and play aroudn with it, then I wouldn't distribute it. Wink I'm glad it's worked out for you in an ASP driven system - very good to know.

It's a good idea to limit resizing up, and it might be something I work in to a future release (but allow people to flip between allowing it and disallowing it).

Regards,

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
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