I am having a heck of a time getting a script to convert images to
work....it worked fine for a few hours, then someone "tweaked it" and now it
doesn't work and I can't get it back...they "tweaked" the original file....

The script runs and uploads files but no longer "converts" them with the
ImageMagick..wondering if anyone else has run into this....


// ---------------------------------- Get Images from
folder--------------------------- //

     $FileName = $row['Image'];   

     $ImageName = $row['Image'];
     $ImageName = str_replace("/",
"", $ImageName);
     //the many confusing paths

//Local path on localhost of image names with NO file extenstion on them as
seen through the webserver
     $FilePath =

     //same as $SysPath not sure why - as of this point
$FileName and $ImageName are the same thing
     $FullSysPath =

     $BackupPath =

    //add jpg extenstion to the filename stored in the harris folder

$FileName = str_replace("/", "", $FileName);
      $FileName =
str_replace(".jpg", "", $FileName);
      $FileName =
str_replace("/", "", $ImageName);
      $FileName = str_replace(".jpg", "",
       //actual path to the files with NO file extension
as found on the hard drive
     $SysPath =

      //lets do some echos
  echo $FileName .'<br>';
$ImageName  .'<br>';

// include ("VariableReveal3.php");

($FileName) . '<br />';
echo ($FilePath) . '<br />';
echo '<img src="' .
$FilePath .'">' . '<br />';

     if (file_exists($SysPath))   {
"The file $ImageName Exists!! Hooray!!"  . '<br />';
} else {

echo "The file $FileName located at $SysPath does not exist"  . '<br

//----------------------------------If they exist go ahead and convert them
WINDOWS VERSION----------------------------//

    if (file_exists($SysPath)) {
       $command =
"convert.exe mogrify -format eps *.jpg -normalize -density 200x200 -trim
-resize 150 -colorspace rgb -filter Sinc -quality 100 ├▒trim -identify
-verbose ";
        $command .= addslashes($SysPath . $FileName) ." ";

$command .= addslashes($FilePath . $FileName) .".jpg";

$command = "convert.exe -normalize -density 200x200 -trim -resize 150
-colorspace rgb -filter Sinc -quality 100  -identify -verbose ";

$command .= addslashes($SysPath) ." ";
          $command .=
addslashes($FullSysPath) ." ";
//echo the command for
the image not so magick
   echo $command . "<br />";

//--------------------------Error Reporting about the

    if (system($command, $status) === false) {
            echo ($command).
'<br />';
     echo "Image Failed" . '<br />';
    } else {

echo "Image Processed" . '<br />';


//-------------------------------Once Converted Then connect to the php
server online----------------------------//

$ftp_server = "";

 $ftp_user_name = "blah blah ";

 $ftp_user_pass = "blahblah";

 $conn_id = ftp_connect($ftp_server);

  $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

$FilePath =  

$remote_path = "/httpdocs/Announcements/photos/obitsTest/$ImageName";

echo "I'm going to upload $FilePath to $remote_path." . '<br />';

        ftp_pasv($conn_id, true);

        // upload a
        if (ftp_put($conn_id, $remote_path, $SysPath, FTP_BINARY)) {

echo "successfully uploaded $ImageName\n";
                } else {

echo "There was a problem while uploading $ImageName\n";


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to