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 to 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
mmjaeger
Light Poster


Joined: 22 Oct 2004
Posts: 25

PostPosted: Wed Oct 27, 2004 4:25 am    Post subject: path to image Reply with quote

Hello,

I'm kind of having problems passing the correct path to the dropshadow.php file. This is what I finally came up with:

$source = $HTTP_SERVER_VARS['DOCUMENT_ROOT'].'/'.$HTTP_GET_VARS['img'];

....?img=/path-to-image/test.jpg is not working.
....?img=http://domain.com/path-to-image/test.jpg is not working either
....?img=../../../../'test.jpg is working.

I'm really kind of confused!?

Your input is very much appreciated.

Thank you
Back to top
View user's profile Send private message
quasipickle
Newbie


Joined: 21 Oct 2004
Posts: 6

PostPosted: Fri Nov 05, 2004 1:48 am    Post subject: Reply with quote

My first guess would be to see if test.jpg is actually in the directory you think it is. You seem to be descending quite a bit into parent directories, before you can display test.jpg.
Back to top
View user's profile Send private message
olfudydudy
Newbie


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

PostPosted: Wed Nov 10, 2004 1:05 pm    Post subject: Reply with quote

Greetings from Atlanta,
I saw this post and just had to add my two cents on the subject.
Based on my exerience, the loadImage path must be a physical
path (c:\path\to\image\file.jpg) but with double \ (\\). The URLs
or virtual paths just don't work for me. Anyway, my solution was
to pass the url of the image file in the html <img> tag to a php
script which _GETs the url, then $imgstr=file_get_contents($url),
then loadImageFromString($imgstr).

Actual code might be something like the following:

In the web page the <img> might be:

<img src="shadowurl.php?url=http://www.domain.com/imagename.jpg&w=100&h=0">
or
<img src="shadowurl.php?url=/subdir/imagename.jpg&w=100&h=0">

The php script, with the file name of shadowurl.php would be:

<?php
require "class.dropshadow.php";
$url=$_GET['url'];
$w=$_GET['w'];
$h=$_GET['h'];
$img=file_get_contents($url);
$ds = new dropShadow(FALSE);
$ds->setShadowPath("d:\\path\\to\\shadow\\images\\");
$ds->loadImageFromString($img);
$ds->resizeToSize($w,$h);
$ds->applyShadow('b6d5e3');
$ds->showShadow('jpg', 50);
?>

Also, using this method, you can still use the dropshadow class with asp scripts, which is what I am doing.
Anyway, hope this helps.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
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