Hi,
I am trying to create a mobile version of my already uploaded file using below code but getting this error
imagecreatefrompng(): is not a valid PNG file
Here is the code:
if (move_uploaded_file($_FILES['photo']['tmp_name'], $uploadedFile))
{
$resource = imagecreatefrompng($uploadedFile);
$small_file = imagescale($resource , 500, 400);
$small_file = imagepng($small_file);
$newSmallFile = "mobile-" . $gallery_uuid . '.png';
$uploadedSmallFile = $uploaddir . $newSmallFile;
echo $uploadedSmallFile;
if (move_uploaded_file($small_file, $uploadedSmallFile))
{
}
else
{
echo json_encode("error");
}
}
else
{
echo json_encode("error");
}
Kindly help…
Thanks,
Jassim