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.


Problems with image path

 
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 -> Crop Canvas
View previous topic :: View next topic  
Author Message
Pericles
Newbie


Joined: 24 Mar 2006
Posts: 2

PostPosted: Fri Mar 24, 2006 8:31 pm    Post subject: Problems with image path Reply with quote

Thanks for a great piece of software...I will most certainly participate with a donation once I get things working properly. I got all things to work very well, except one. I will implement your app in a multi-user environment, so the images to be cropped will be uploaded to a directory other than where the script resides. The script works fine as long as the image is in the same folder, but for the life of me I cannot get it to take a different path. I've tried:

$ci->loadInterface("/home/username/images/users/file.jpg");
The above line gets "http://site.com" prepended to the path

$ci->loadInterface("images/users/file.jpg");
I get "file.jpg" not found

I tried to include the path to a variable like $img then tried
$ci->loadInterface($img);

Nothing works whatsoever. Any ideas how I can get this working and what the problem could be? Is there a way to grab the file using html? Unfortunately my isp has file_get_contents() disabled in the server config so I can't take that approach.

Any suggestion would be greatly appreciated.

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


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

PostPosted: Sat Mar 25, 2006 6:31 am    Post subject: Reply with quote

Hi, and welcome to the board!

This thread might help you out with the path stuff:

http://php.amnuts.com/forums/viewtopic.php?t=129

As for getting remote files:

Have they also disbaled the file() function, or is it just the http wrappers that they've disabled? (Ie, can you use file_get_contents() or file() on just local files?) You could try using sockets, if they've left that active. Try the connectViaSocket() function found on this thread:

http://php.amnuts.com/forums/viewtopic.php?t=294

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


Joined: 24 Mar 2006
Posts: 2

PostPosted: Mon Mar 27, 2006 10:26 pm    Post subject: thanks Reply with quote

Thanks for your quick reply...I resolved this by editing line 183 in class.cropinterface.php to

PHP:
<?php echo '<tr><td><img src=&quot;'str_replace($_SERVER['DOCUMENT_ROOT'], ''$this->file), '&quot; '$this->img['sizes'][3], ' alt=&quot;crop this image&quot; name=&quot;theImage&quot;></td></tr>', &quot;\n&quot;; ?>


Again, what a great piece of software...thank you! One issue that I am nor surprised that comes up is that .gif files with transparent backgrouns have transparency turning into black after processing. Of course, it is not a complaint, just an observation and there should be no reason for someone to use this application with transparent .gifs.
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 -> Crop Canvas 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