/**
  * If there is no image this is giving us a mess of an image with a huge icon.
  */
 function get_av_img_url($image)
 {
     $width = $this->width;
     $height = $this->height;
     $crop_style = $this->crop_style;
     $id = $image->get_value('id');
     $rsi = new reasonSizedImage();
     $rsi->set_id($id);
     $rsi->set_width($width);
     $rsi->set_height($height);
     $rsi->set_crop_style($crop_style);
     $watermark = $this->get_watermark_absolute_path($this->media_works_type);
     $options = array();
     $options['horizontal'] = "center";
     $options['vertical'] = "center";
     $rsi->set_blit($watermark, $options);
     $rsi->use_absolute_urls($this->use_absolute_urls);
     $url = $rsi->get_url();
     return $url;
 }
function resize_av_images($image_id_str)
{
    global $d;
    $img_ids = explode(",", $image_id_str);
    $types = explode(",", $d['av_type']);
    $width = (int) $d['w'];
    $height = (int) $d['h'];
    $crop_style = $d['crop_style'];
    $url = array();
    $fh = new Feature_Helper();
    $curr = 0;
    foreach ($img_ids as $id) {
        if ($id != "none") {
            $rsi = new reasonSizedImage();
            $rsi->set_id($id);
            $rsi->set_width($width);
            $rsi->set_height($height);
            $rsi->set_crop_style($crop_style);
            $watermark = $fh->get_watermark_absolute_path($types[$curr]);
            //$options=array('horizontal'=>'center','vertical'=>'center');
            $options = array();
            $options['horizontal'] = "center";
            $options['vertical'] = "center";
            $rsi->set_blit($watermark, $options);
            //			$rsi->_make();
            $url[] = $rsi->get_url();
            //			$path=$rsi->get_file_system_path_and_file_of_dest();
            //			blit_image($path,$path,$watermark,$options);
            $curr++;
        }
    }
    $str = "";
    for ($i = 0; $i < count($url); $i++) {
        $str .= "" . $url[$i] . ",";
    }
    $str = trim($str, ",");
    return $str;
}