TFD3 Posted May 22, 2008 Share Posted May 22, 2008 Hi I have a image: http://farm3.static.flickr.com/2101/2513017560_709909f068_o.jpg that I need to crop to get only the radar image to show up. I am using this script: <?php $w=$_GET['w']; $h=isset($_GET['h'])?$_GET['h']:$w; // h est facultatif, =w par défaut $x=isset($_GET['x'])?$_GET['x']:0; // x est facultatif, 0 par défaut $y=isset($_GET['y'])?$_GET['y']:0; // y est facultatif, 0 par défaut $filename=$_GET['src']; header('Content-type: image/jpg'); header('Content-Disposition: attachment; filename='.$src); $image = imagecreatefromjpeg($filename); $crop = imagecreatetruecolor($w,$h); imagecopy ( $crop, $image, 0, 0, $x, $y, $w, $h ); imagejpeg($crop); ?> To use the script, use this URL: http://www.alabamaweather.org/gr2ae/images/gr2ae.php?x=10&y=20&w=30&h=40&src=gr2ae.jpg But when I use the above URL it wants me to download a file instead of displaying the cropped image. ????? Kenny Link to comment https://forums.phpfreaks.com/topic/106715-crop-image-help/ Share on other sites More sharing options...
yuws Posted May 22, 2008 Share Posted May 22, 2008 the link to your image url is forbidin Link to comment https://forums.phpfreaks.com/topic/106715-crop-image-help/#findComment-547040 Share on other sites More sharing options...
TFD3 Posted May 22, 2008 Author Share Posted May 22, 2008 the link to your image url is forbidin Try this: http://farm3.static.flickr.com/2101/2513017560_709909f068_o.jpg Link to comment https://forums.phpfreaks.com/topic/106715-crop-image-help/#findComment-547041 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.