on my website you can upload images and I intend to allow at least 16k resolution for each upload. When displaying the image on the website I want to use a thumbnail image.
To create the thumbnail image I'm using the php code below:
<?php
$imageUploadFile = $_FILES["passimagefile"]["tmp_name"];
$src = imagecreatefromjpeg($imageUploadFile);
list( $width, $height ) = getimagesize( $imageUploadFile );
$tmp = imagecreatetruecolor( $width / $height * 700, 700 );
imagecopyresampled($tmp, $src, 0, 0, 0, 0, $width / $height * 700, 700, $width, $height);
imagejpeg($tmp, $taget_thumbnail, 75);
?>
This works perfectly fine for most smaller (1k-4k) images. The thumbnail is correctly being generated. However, when I go and try to do it with an image that is like 6k or 8k the result is suddenly wrong.
The thumbnail image is being generated however it is completely black.
Is there a way to fix this?