26 lines
620 B
PHP
26 lines
620 B
PHP
|
|
<?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);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|