Jump to content

using phMagick - it's moving an image, but...


richrock

Recommended Posts

It's not resizing it:

 

// Init the image counter
	$img_number = 0;
	//echo "Img Num: ".$img_number."<br />";
        
        foreach ($_FILES["pictures"]["error"] as $key => $error) {

		if ($error == UPLOAD_ERR_OK) {

			$tmp_name = $_FILES["pictures"]["tmp_name"][$key];
                //echo "TMP Name: ".$tmp_name;
			$name = $_FILES["pictures"]["name"][$key];

			$newname = $rec_num."-".$line_num.".jpg";
			$path = _PICTURES_PATH;
                echo $tmp_name;
                echo "<br />".$path;

                //Created folder.
			move_uploaded_file($tmp_name,$path."/".$newname);
                //resing to fit a particuar width

                $phMagick = &new phMagick($newname);
                $phMagick->setDestination($newname)->resize(80,150,true);

                echo "<br />".$path.$newname;


                $img_number++;

            } // Endif
        }

And this is copied straight from the phMagick page - which btw, has absolutely NO documentation, just examples.  Maybe I'm not using it right, I don't know - I've never really plugged a class like this into a script I've written

 

Any help would be given beers/greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/142970-using-phmagick-its-moving-an-image-but/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.