Helpful Information
Home
Categories
Contact us
Category: Programming Languages
ImageCopyResized()
I have seen a application using the ImageCopyResized() function with GIF file.
Can this function be used with JPEG.
Thanks
Claude
<?php
header ("Content-type: image/jpeg");
$new_w=109;
$new_h=155;
$dst_img=ImageCreate($new_w,$new_h);
$src_img=ImageCreateFromjpeg("path_or_url_to/images/7008287.jpg");
ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
Imagejpeg($dst_img);
?>
change the width and height and your image will change.make shure your path is correct for it to work
privacy (GDPR)