Re: Php and Imagemagick problems
| From: | Simon | Date: | Wed, 10 Jun 2009 16:30:23 +0000 |
| Subject: | Re: Php and Imagemagick problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293878@lists.php.net to get a copy of this message | ||
What exactly is the problem or error message you get?
Also if this is your script, really, it needs a LOT of cleanup!!
Here's an example that could point out the problem:
> $FileName =
> str_replace(".jpg", "", $FileName);
>
> $FileName =
> str_replace("/", "", $ImageName);
> $FileName = str_replace(".jpg", "",
> $ImageName);
>
> //actual path to the files with NO file extension
> as found on the hard drive
> $SysPath =
> "C:/Inetpub/wwwroot/HarrisAutomate/output/WebImagesHiRes/test/$FileName";
You realize that you have overwritten the value in $FileName a couple
times in a useless manner?
Here you see, $FileName is _just_ equal to str_replace(".jpg", "",
$ImageName); and nothing more, the 2 previous lines are useless.
Also, you do realize that str_replace("/", "", $ImageName); will just
strip out the slashes from $ImageName? So if i have
"some/path/to/some/image.jpg", it would become
"somepathtosomeimage.jpg"... is this really what you want? Same thing
for the str_replace(".jpg"....) it strips out the extension so that
$Filename would be something like "image" and not "image.jpg".
Finally, $SysPath has forward slashes in the windows path, i'm not
sure how PHP can tolerate this on windows, but windows path use
backslashes ( like this: C:\some\path\to\some\image.jpg).
Good luck!