Skip to content
Advertisement

Laravel Image Quality

Every time I upload a new image to my server, this image is resized. The main issue I’m having is that the image is losing a lot of quality. This is the current code:

    $name1 = str_random(10);
    $img = Image::make($img1);
    $img->resize(270,152, function ($constraint) {$constraint->aspectRatio();});
    $img->crop(160, 132, 55, 0);
    $img->save('/imagenes/'.$name1.'.jpg', 100);
    $escena->img1_plx = $name1.'.jpg';

I tried with different changes but the image still lose many quality

Advertisement

Answer

You can try a new library: Intervention Image

Here is the link: Intervention Image

You can choose format, dimensions, crop and quality for the images.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement