1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 08:14:10 +00:00

Update Image util

This commit is contained in:
Daniel Supernault 2018-11-18 21:56:22 -07:00
parent de11fa90af
commit 46fdcf0718
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -15,7 +15,7 @@ class Image
public $orientation;
public $acceptedMimes = [
'image/png',
'image/jpeg',
'image/jpeg'
];
public function __construct()
@ -114,9 +114,11 @@ class Image
if($thumbnail) {
$img->crop($aspect['width'], $aspect['height']);
} else {
$metadata = $img->exif();
$img->resize($aspect['width'], $aspect['height'], function ($constraint) {
$constraint->aspectRatio();
});
$media->metadata = json_encode($metadata);
}
$converted = $this->setBaseName($path, $thumbnail, $img->extension);
$newPath = storage_path('app/'.$converted['path']);