Skip to content

Commit

Permalink
Avoid using 2.3x the image size worth of memory when no memory is enough
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Feb 4, 2016
1 parent 84cdc40 commit f5f3028
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Imagine/Image/Metadata/ExifMetadataReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ public static function isSupported()
*/
protected function extractFromFile($file)
{
if (stream_is_local($file)) {
if (false === is_readable($file)) {
throw new InvalidArgumentException(sprintf('File %s is not readable.', $file));
}

return $this->extract($file);
}

if (false === $data = @file_get_contents($file)) {
throw new InvalidArgumentException(sprintf('File %s is not readable.', $file));
}
Expand Down

0 comments on commit f5f3028

Please sign in to comment.