Re: [PHP] Php and Imagemagick problems

[email protected] (Simon)
Newsgroups php.general
Message-ID <[email protected]>
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!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.