Resize image using php Imagemagick -


am

Cvimegik work try using "thumbnail images" to change the image size I just, I Not doing anything with the image, just to resonate the new dimensions to see if it works. And so far, it is not working here is my code Note: It resonates the original dimensions, not just for new people. $ image = $ _FILES ["file"] ["tmp_name"]; // Get the original dimension list ($ width, $ height, $ type, $ attr) = getimagesize ($ image); Echo "& lt; BR & gt;"; Dumb "original:"; Echo "& lt; BR & gt;"; Echo "image width $ width"; Echo "& lt; BR & gt;"; Echo "image height" $ Height; $ Max_height = 200; $ Max_width = 150; Function Thumbnail ($ image, $ max_width, $ max_height) {$ img = New Imagick ($ image); $ Img- & gt; Thumbnail image ($ max_width, $ max_height, TRUE); $ Img return; } Thumbnail ($ image, $ max_width, $ max_height); // Get new dimension list ($ width, $ height, $ type, $ attr) = getimagesize ($ img); Echo "& lt; BR & gt;"; Echo "new:"; Echo "& lt; BR & gt;"; Echo "image width $ width"; Echo "& lt; BR & gt;"; Echo "image height" $ Height;

This is not showing the second set of echo. Now there are errors

With your modifications, you can use both to get the width and height Can: $ img = Thumbnail ($ image, $ max_width, $ max_height); $ Width = $ img- & gt; GetImageWidth (); $ Height = $ img- & gt; GetImageHeight (); Var_dump ($ width, $ height);

This method has not been documented and its return value can not be expected, so be careful about it!

Comments