Created
September 23, 2020 19:31
-
-
Save maagmirror/8bd06fa785d26870b59d4321fcfa2674 to your computer and use it in GitHub Desktop.
dummy php to resize images with url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$img = $_GET['img']; | |
$height = $_GET['height']; | |
$width = $_GET['width']; | |
$remote_file = $img; | |
$new_width = $width; | |
$new_height = $height; | |
list($width, $height) = getimagesize($remote_file); | |
$image_p = imagecreatetruecolor($new_width, $new_height); | |
$image = imagecreatefromjpeg($remote_file); | |
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); | |
header('Content-Type: image/jpeg'); | |
imagejpeg($image_p, NULL, 100); | |
imagedestroy($image_p); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment