|
@@ 194-205 (lines=12) @@
|
| 191 |
|
} |
| 192 |
|
|
| 193 |
|
// try all custom mappers |
| 194 |
|
if (!static::isValidImageHandle($handle)) { |
| 195 |
|
$custom_mappers = MapperFactory::getCustomMappers(); |
| 196 |
|
|
| 197 |
|
foreach ($custom_mappers as $mime_type => $mapper_class) { |
| 198 |
|
$mapper = MapperFactory::selectMapper(null, $mime_type); |
| 199 |
|
$handle = $mapper->loadFromString($data); |
| 200 |
|
|
| 201 |
|
if (static::isValidImageHandle($handle)) { |
| 202 |
|
break; |
| 203 |
|
} |
| 204 |
|
} |
| 205 |
|
} |
| 206 |
|
} |
| 207 |
|
|
| 208 |
|
if (!static::isValidImageHandle($handle)) { |
|
@@ 229-240 (lines=12) @@
|
| 226 |
|
|
| 227 |
|
$handle = @imagecreatefromstring($string); |
| 228 |
|
|
| 229 |
|
if (!static::isValidImageHandle($handle)) { |
| 230 |
|
$custom_mappers = MapperFactory::getCustomMappers(); |
| 231 |
|
|
| 232 |
|
foreach ($custom_mappers as $mime_type => $mapper_class) { |
| 233 |
|
$mapper = MapperFactory::selectMapper(null, $mime_type); |
| 234 |
|
$handle = $mapper->loadFromString($string); |
| 235 |
|
|
| 236 |
|
if (static::isValidImageHandle($handle)) { |
| 237 |
|
break; |
| 238 |
|
} |
| 239 |
|
} |
| 240 |
|
} |
| 241 |
|
|
| 242 |
|
if (!static::isValidImageHandle($handle)) { |
| 243 |
|
throw new InvalidImageSourceException("String doesn't contain valid image data."); |