Changeset 14143 for trunk/include/derivative.inc.php
- Timestamp:
- Apr 14, 2012, 6:52:20 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/derivative.inc.php
r13843 r14143 27 27 public $id; 28 28 public $rel_path; 29 public $rotation = 0; 29 30 30 31 private $size=null; … … 59 60 $height = $infos['height']; 60 61 62 $this->rotation = intval($infos['rotation']) % 4; 61 63 // 1 or 5 => 90 clockwise 62 64 // 3 or 7 => 270 clockwise 63 if ($ infos['rotation'] % 2 != 0)65 if ($this->rotation % 2) 64 66 { 65 67 $width = $infos['height']; … … 174 176 if ( $src->has_size() && $params->is_identity( $src->get_size() ) ) 175 177 { 176 // todo - what if we have a watermark maybe return a smaller size? 177 $params = null; 178 $rel_path = $rel_url = $src->rel_path; 179 return; 178 if (!$params->use_watermark && !$src->rotation) 179 { 180 $params = null; 181 $rel_path = $rel_url = $src->rel_path; 182 return; 183 } 184 $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 185 for ($i=0; $i<count($defined_types); $i++) 186 { 187 if ($defined_types[$i] == $params->type) 188 { 189 for ($i--; $i>=0; $i--) 190 { 191 $smaller = ImageStdParams::get_by_type($defined_types[$i]); 192 if ($smaller->sizing->max_crop==$params->sizing->max_crop && $smaller->is_identity( $src->get_size() )) 193 { 194 $params = $smaller; 195 self::build($src, $params, $rel_path, $rel_url, $is_cached); 196 return; 197 } 198 } 199 break; 200 } 201 } 180 202 } 181 203
Note: See TracChangeset
for help on using the changeset viewer.