/var/www/vhosts/ihelp.ro/httpdocs/src/View/Helper
Edit: /var/www/vhosts/ihelp.ro/httpdocs/src/View/Helper/CustomHelper.php (1971B)
Thumb->resize($pathImg, ['width' => $size['width'], 'height' => $size['height'], 'format' => $size['format']]);
} else {
return $this->Thumb->resize('no-image-icon.png', ['width' => $size['width'], 'height' => $size['height'], 'format' => $size['format']]);
}
}
// generateUrlHdy
public function generateUrlHdy($path = [], $cdn = true, $width = 640, $height = 480, $crop = false, $cropDirection = 'top')
{
$cdn = false; // remove HDY
if ($path['model_name'] == 'Profiles') {
$pathImg = UPLOAD_IMAGE . $path['model_name'] . '/' . $path['image_name'];
} else {
$pathImg = UPLOAD_IMAGE . $path['model_name'] . '/' . $path['uuid'] . '/' . $path['image_name'];
}
if ($crop == true) {
//$crop = '&crop=top';
$crop = '&crop=focalpoint';
$fit = 'crop';
} else {
$fit = 'fill';
$crop = '';
}
if ($cdn) {
return 'https://' . HDY_DOMAIN . '.hdy.ro/' . $pathImg . '?fm=webp&auto=compress&fit=' . $fit . '&fill=solid&fill-color=FFFFFF&w=' . $width . '&h=' . $height . '' . $crop;
} else {
if (!is_file(WWW_ROOT . 'img' . DS . $pathImg)) {
$pathImg = UPLOAD_IMAGE_DEFAULT;
}
return $pathImg;
}
}
}