Joywork/import/helper/ImageHelper.php
2026-05-22 21:21:54 +03:00

26 lines
620 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
abstract class ImageHelper
{
/**
* Метод ипользуется толкьо в биледрах и надо его вынести в билдер!
*
* @deprecated
*/
public static function getFullUrl($filename)
{
assert('!empty($filename)');
$fn = pathinfo($filename, PATHINFO_FILENAME);
$dir = substr($fn, -2, 2);
return 'https://nb.joywork.ru/' . $dir . '/' . $filename;
}
public static function getResizedUrl($url, $width, $height, $resize)
{
$resizeStr = sprintf('_%d_%d_%d', $resize, $width, $height);
return preg_replace('/(\.[^\.+]+)$/i', $resizeStr.'$1', $url);
}
}