mirror of
https://github.com/Intervention/image.git
synced 2025-08-13 17:34:04 +02:00
Rewrite exception messages for methods in AbstractDecoder
This commit is contained in:
@@ -23,11 +23,11 @@ abstract class AbstractDecoder extends SpecializableDecoder implements Specializ
|
||||
$info = @getimagesize($filepath);
|
||||
|
||||
if (!is_array($info)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
throw new DecoderException('Unable to detect media (MIME) from data in file path.');
|
||||
}
|
||||
|
||||
if (!array_key_exists('mime', $info)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
throw new DecoderException('Unable to detect media (MIME) from data in file path.');
|
||||
}
|
||||
|
||||
return MediaType::from($info['mime']);
|
||||
@@ -45,11 +45,11 @@ abstract class AbstractDecoder extends SpecializableDecoder implements Specializ
|
||||
$info = @getimagesizefromstring($data);
|
||||
|
||||
if (!is_array($info)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
throw new DecoderException('Unable to detect media (MIME) from binary data.');
|
||||
}
|
||||
|
||||
if (!array_key_exists('mime', $info)) {
|
||||
throw new DecoderException('Unable to decode input');
|
||||
throw new DecoderException('Unable to detect media (MIME) from binary data.');
|
||||
}
|
||||
|
||||
return MediaType::from($info['mime']);
|
||||
|
Reference in New Issue
Block a user