Minor fixes and support for HEIC images

This commit is contained in:
Deon George
2020-01-02 09:42:59 +11:00
parent fe155525a3
commit c5fcfdc1d7
7 changed files with 49 additions and 14 deletions

View File

@@ -133,6 +133,7 @@ class Photo extends Abstracted\Catalog
if (array_key_exists($this->orientation,$this->_rotate))
$imo->rotateImage(new \ImagickPixel('none'),$this->_rotate[$this->orientation]);
$imo->setImageFormat('jpg');
return $imo->getImageBlob();
}
@@ -236,7 +237,13 @@ class Photo extends Abstracted\Catalog
public function thumbnail($rotate=TRUE)
{
if (! $this->thumbnail) {
return $this->o()->thumbnailimage(200,200,true,true) ? $this->_o->getImageBlob() : NULL;
if ($this->o()->thumbnailimage(200,200,true,false)) {
$this->_o->setImageFormat('jpg');
return $this->_o->getImageBlob();
} else {
return NULL;
}
}
if (! $rotate OR ! array_key_exists($this->orientation,$this->_rotate) OR ! extension_loaded('imagick'))
@@ -244,6 +251,7 @@ class Photo extends Abstracted\Catalog
$imo = new \Imagick();
$imo->readImageBlob($this->thumbnail);
$imo->setImageFormat('jpg');
return $this->rotate($imo);
}