I am trying to make different resolutions of same image (like 1080x1920 , 1280x720 , 1920x1080
etc ).I am using the GD library of php. I am able to get the desired resolution (i.e 1080x1920)
but the original image(1080x1920) is shrinked in the new image.
original picture , Picture that I am getting , Desired output
Here is my code
<?php
$old_img_path="ironspider-xq.jpg";
$t = imagecreatefromjpeg("$old_img_path");
$s = imagecreatetruecolor(1080, 1920);
$x = imagesx($t);
$y = imagesy($t);
imagecopyresampled($s, $t, 0, 0, 0, 0, 1080, 1920, $x, $y);
imagejpeg($s, "1080x1920-ironspider-xq.jpg");
$new_img_path= "1080x1920-".$old_img_path;
?>