예제 #1
0
 /**
 * Изменяет и сохраняет изображение
 */
 function saveImage($src, $dst, $param = null)
 {
     $img = new images($src, isset($param['w']) ? intval($param['w']) : null, isset($param['h']) ? intval($param['h']) : null, isset($param['fixed']) ? true : false, isset($param['ha']) ? $param['ha'] : 'center', isset($param['va']) ? $param['va'] : 'middle', isset($param['rgb']) ? $param['rgb'] : null, isset($param['alpha']) ? true : false, isset($param['max']) ? $param['max'] : 1024);
     if (isset($param['waterMark'])) {
         $water = new images($param['waterMark'], isset($param['waterW']) ? intval($param['waterW']) : null, isset($param['waterH']) ? intval($param['waterH']) : null, isset($param['waterFixed']) ? true : false, isset($param['waterHa']) ? $param['waterHa'] : 'center', isset($param['waterVa']) ? $param['waterVa'] : 'middle', isset($param['waterRGB']) ? $param['waterRGB'] : null, isset($param['waterAlpha']) ? true : false, isset($param['waterMax']) ? $param['waterMax'] : 1024);
         $img->addWatermark($water, isset($param['waterOffsetX']) ? $param['waterOffsetX'] : 0, isset($param['waterOffsetY']) ? $param['waterOffsetY'] : 0, isset($param['waterOpacity']) ? $param['waterOpacity'] : 100, isset($param['waterAlignH']) ? $param['waterAlignH'] : null, isset($param['waterAlignV']) ? $param['waterAlignV'] : null);
     }
     $res = $img->save($dst);
     if (isset($param['waterMark'])) {
         $water->__destruct();
     }
     $img->__destruct();
     return $res;
 }