I am trying to use libvips writeToBuffer
method with quality, but it's not apply the quality to the image is there any other method for set the quality. I have below case if file exists then it call the writeToFile
otherwise writeToBuffer
. IS there any solution for achieve below case?
$image = Vips\Image::newFromFile($sourceimgfile);
$result = $image->writeToBuffer('.jpg', ['Q' => 50]);
file_put_contents($destinationimgfile, $result);
Actual output:
If I set image quality 50, then it should give me low resolution image but still it generate same image like input image. It didn't applied the quality on image.