| 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 | } |