PNG is lossless so quality is a redundant parameter anyway.
Also, the encode() method appears to take quality as an optional second parameter. http://image.intervention.io/api/encode
I am trying to set the image quality when I use image intervention
Reading the docs it says that quality can be set when using save():
$img->save('public/bar.png', 100);
But I never use the save() function since I dont want to store any images on my server, I want to store them on amazon s3 using the store function.
This is what I use:
public function uploadLargeAndMainImages($file,$id)
{
$s3 = Storage::disk('s3');
$extension = $file->guessExtension();
$filename = uniqid() . '.' . $extension;
//Create and resize images
$image = Image::make($file)->resize(null, 600, function ($constraint) {
$constraint->aspectRatio();
});
$image->encode($extension);
$imageLarge = Image::make($file)->resize(null, 800, function ($constraint) {
$constraint->aspectRatio();
});
$imageLarge->encode($extension);
// upload image to S3
$s3->put("images/{$id}/medium/" . $filename, (string) $image, 'public');
$s3->put("images/{$id}/large/" . $filename, (string) $imageLarge, 'public');
}
This will never set the image quality, so must I first save the images on my server then upload them to amazon s3 if I wish to set the quality?
Please or to participate in this conversation.