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.


Path Syntax

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


Joined: 11 Jul 2005
Posts: 21

PostPosted: Tue Jul 19, 2005 3:58 pm    Post subject: Path Syntax Reply with quote

Hi there,

I was wonder what the proper way was to pass the image path information to the class?

The standard:
Code:
$ds->setShadowPath('./shadows/');


But I would like to use an absolute path, such as "http://mysite.com/images/shadows/"

... I suppose the same goes for the "$ds->loadImage" line. ... especially if I would like to link to a graphic that doesn't reside on my site.

Thanks!

//craig
Phoenix, AZ
Back to top
View user's profile Send private message Visit poster's website
amnuts
Site Admin


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

PostPosted: Tue Jul 19, 2005 4:29 pm    Post subject: Reply with quote

Hi Craig,

Can't be done as simple as that, I'm afraid. The GD image loading functions don't use the same kind of wrappers that other PHP file functions might, such as file() or file_get_contents(). The best you could do is use one of the wrapper functions to get the image to your site and then load it up from the local file system.

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


Joined: 11 Jul 2005
Posts: 21

PostPosted: Tue Jul 19, 2005 4:38 pm    Post subject: Reply with quote

So the loadImage function actually requires that the image (path to the image) reside on my site?

... that means that I should use this method instead, right?

Code:
$img = file_get_content('http://mysite.com/image.jpg');
$ds->loadImageFromString($img);
Back to top
View user's profile Send private message Visit poster's website
amnuts
Site Admin


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

PostPosted: Wed Jul 20, 2005 3:40 am    Post subject: Reply with quote

You sure can! the file_get_contents() function is binary safe, so will work with image data. So long as you have the fopen wrappers enabled that should work.

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