Skip to content

Commit

Permalink
Added support for non-GD-images, closes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed May 19, 2014
1 parent ad394d4 commit 99a6aa1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/MadeYourDay/Contao/Element/CustomElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function getImageObject($id, $size = null, $maxSize = null)
}

$file = new \File($image->path, true);
if (!$file->isGdImage) {
if (!$file->exists()) {
return null;
}

Expand Down Expand Up @@ -192,6 +192,11 @@ public function getImageObject($id, $size = null, $maxSize = null)

$imageObject = new \stdClass();
$this->addImageToTemplate($imageObject, $image, $maxSize);

if (empty($imageObject->src)) {
$imageObject->src = $imageObject->singleSRC;
}

return $imageObject;
}

Expand Down

0 comments on commit 99a6aa1

Please sign in to comment.