Interlace output jpeg

cap
Varun Patil 2022-12-02 19:08:53 -08:00
parent dbaf9dcc1b
commit 145d6affdd
2 changed files with 5 additions and 0 deletions

View File

@ -140,6 +140,10 @@ class FacesController extends ApiBase
return new DataResponse([], Http::STATUS_NOT_FOUND);
}
// Set quality and make progressive
$image->setImageCompressionQuality(80);
$image->setInterlaceScheme(\Imagick::INTERLACE_PLANE);
// Crop image
$dw = (float) $detection['width'];
$dh = (float) $detection['height'];

View File

@ -126,6 +126,7 @@ class ImageController extends ApiBase
$image = new \Imagick($path);
$image->setImageFormat('jpeg');
$image->setImageCompressionQuality(95);
$image->setInterlaceScheme(\Imagick::INTERLACE_PLANE);
$blob = $image->getImageBlob();
// Return the image