Skip to content

Instantly share code, notes, and snippets.

@beshkenadze
Created April 8, 2019 17:59
Show Gist options
  • Save beshkenadze/87364ead6031c17ea5ad00fb8ce42c45 to your computer and use it in GitHub Desktop.
Save beshkenadze/87364ead6031c17ea5ad00fb8ce42c45 to your computer and use it in GitHub Desktop.
<?php
$srcImage = "./test.jpg";
list($width, $height) = getimagesize($srcImage);
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($srcImage);
imagecopyresampled($image_p,$image,0,0,0,0,100, 100, $width, $height);
imagejpeg($image_p, "./test2.jpg", 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment