3

I'm uploading an image using the below commands to Amazon S3:

$image = Image::make($request->file('image'))->encode('jpg', 100);
$image = $image->fit(1440, 768);
$image->save('uploads/image.jpg');
$s3 = Storage::disk('s3');
$s3->put('cdn/uploads/image.jpg', fopen('uploads/image.jpg', 'r+'), 'public');

Although quality is at 100, an image larger than 1440x768 is saved with a very poor quality.

Am I overseeing something here?

I also tried uploading the image one on one, like below and still losing quality. Very clearly seeing the JPG compression

$image = Image::make($request->file('image'));
$image->save('uploads/image.jpg');
$s3 = Storage::disk('s3');
$s3->put('cdn/uploads/image.jpg', fopen('uploads/image.jpg', 'r+'), 'public');

Can it be that there is a global GD setting for compression??

Alvin Bakker
  • 1,456
  • 21
  • 40

0 Answers0