Commit f9566281 authored by Richard Mansfield's avatar Richard Mansfield

Fix warning from getimagesize called on empty files (bug #848595)

If there are image artefacts with zero size files, getimagesize
outputs unfriendly "Read error!" warnings into the logs.

Change-Id: I9cd8fcf990709da3b34b5530235a065253ce46df
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 088b278d
...@@ -519,7 +519,7 @@ function get_dataroot_image_path($path, $id, $size=null) { ...@@ -519,7 +519,7 @@ function get_dataroot_image_path($path, $id, $size=null) {
// Image is not available in this size. If there is a base image for // Image is not available in this size. If there is a base image for
// it, we can make one however. // it, we can make one however.
if (is_readable($originalimage)) { if (is_readable($originalimage) && filesize($originalimage)) {
$imageinfo = getimagesize($originalimage); $imageinfo = getimagesize($originalimage);
$originalmimetype = $imageinfo['mime']; $originalmimetype = $imageinfo['mime'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment