Add (ai gen)
This commit is contained in:
@@ -188,9 +188,17 @@ private static function filterImages(array $images, string $proxy, string $user_
|
|||||||
$sizeKb = round(strlen($imageData) / 1024, 2);
|
$sizeKb = round(strlen($imageData) / 1024, 2);
|
||||||
|
|
||||||
// Check constraints
|
// Check constraints
|
||||||
if ($width < 800 || $height < 800 || $sizeKb < 100 || $mime !== 'image/jpeg') {
|
if ($width < 300 || $height < 300) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$interventionImage->resize(800, null, function ($constraint) {
|
||||||
|
$constraint->aspectRatio();
|
||||||
|
});
|
||||||
|
$width = $interventionImage->width();
|
||||||
|
$height = $interventionImage->height();
|
||||||
|
$mime = $interventionImage->mime();
|
||||||
|
|
||||||
$image['width'] = $width;
|
$image['width'] = $width;
|
||||||
$image['height'] = $height;
|
$image['height'] = $height;
|
||||||
$image['mime'] = $mime;
|
$image['mime'] = $mime;
|
||||||
|
|||||||
@@ -244,9 +244,17 @@ private static function filterImages(array $images, string $proxy, string $user_
|
|||||||
$sizeKb = round(strlen($imageData) / 1024, 2);
|
$sizeKb = round(strlen($imageData) / 1024, 2);
|
||||||
|
|
||||||
// Check constraints
|
// Check constraints
|
||||||
if ($width < 800 || $height < 800 || $sizeKb < 100) {
|
if ($width < 300 || $height < 300) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$interventionImage->resize(800, null, function ($constraint) {
|
||||||
|
$constraint->aspectRatio();
|
||||||
|
});
|
||||||
|
$width = $interventionImage->width();
|
||||||
|
$height = $interventionImage->height();
|
||||||
|
$mime = $interventionImage->mime();
|
||||||
|
|
||||||
$image['width'] = $width;
|
$image['width'] = $width;
|
||||||
$image['height'] = $height;
|
$image['height'] = $height;
|
||||||
$image['mime'] = $mime;
|
$image['mime'] = $mime;
|
||||||
|
|||||||
Reference in New Issue
Block a user