Minor fixes and support for HEIC images
This commit is contained in:
@@ -13,21 +13,42 @@ abstract class Catalog extends Model
|
||||
{
|
||||
protected static $includeSubSecTime = FALSE;
|
||||
|
||||
/**
|
||||
* People in Multimedia Object
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function people()
|
||||
{
|
||||
return $this->belongsToMany(Person::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Software used to create Multimedia Object
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function software()
|
||||
{
|
||||
return $this->belongsTo(Software::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tags added to Multimedia Object
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function tags()
|
||||
{
|
||||
return $this->belongsToMany(Tag::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search Database for duplicates of this object
|
||||
*
|
||||
* @param $query
|
||||
* @return mixed
|
||||
*/
|
||||
public function scopeDuplicates($query) {
|
||||
if (! $this->exists)
|
||||
return $query;
|
||||
@@ -102,12 +123,13 @@ abstract class Catalog extends Model
|
||||
});
|
||||
}
|
||||
|
||||
abstract public function setDateCreated();
|
||||
abstract public function setLocation();
|
||||
abstract public function setSignature();
|
||||
abstract public function setSubSecTime();
|
||||
abstract public function setThumbnail();
|
||||
abstract public function getHtmlImageURL();
|
||||
// Children objects must inherit this methods
|
||||
abstract public function setDateCreated();
|
||||
abstract public function setLocation();
|
||||
abstract public function setSignature();
|
||||
abstract public function setSubSecTime();
|
||||
abstract public function setThumbnail();
|
||||
abstract public function getHtmlImageURL();
|
||||
|
||||
/**
|
||||
* Date the multimedia was created
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user