I upload a jpg file, also create a thumbnail from it and store both
I want to set quality to 80 for both
for thumbnail, I think if I add a 80 at the end of thumbnail creation code, it'll work
Code: Select all
$sourceImage = imagecreatefromjpeg("$sourcePath/$sourceName");
$sourceWidth = imagesx($sourceImage);
$sourceHeight = imagesy($sourceImage);
$targetImage = imagecreate($thumbWidth,$thumbHeight);
imagecopyresized($targetImage,$sourceImage,0,0,0,0,$thumbWidth,
$thumbWidth,imagesx($sourceImage),imagesy($sourceImage));
imagejpeg($targetImage, "$thumbPath/$thumbName",80);I have to create a thumbnail but the size with original size of the image? to set quality
Thanks