Skip to content

Commit

Permalink
Return "problem" image if no keyImage.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jan 19, 2017
1 parent 2147177 commit c8c27c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ansel/lib/Gallery.php
Expand Up @@ -1233,7 +1233,11 @@ public function toJson($level = 0, $mini = false)
$json->dc = $this->get('date_created');
$json->dm = $this->get('last_modified');
$json->d = $this->get('desc');
if ($mini) {

$ki = $this->getKeyImage($style);
if (!$ki) {
$json->ki = Horde_Themes::img('thumb-error.png')->fulluri->toString(true);
} elseif ($mini) {
$json->ki = Ansel::getImageUrl($this->getKeyImage($style), 'Mini', false)->toString(true);
} else {
$json->ki = Ansel::getImageUrl($this->getKeyImage($style), 'Thumb', false, $style)->toString(true);
Expand Down

0 comments on commit c8c27c3

Please sign in to comment.