mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 00:35:59 +00:00
Update Image util
This commit is contained in:
parent
de11fa90af
commit
46fdcf0718
1 changed files with 3 additions and 1 deletions
|
@ -15,7 +15,7 @@ class Image
|
||||||
public $orientation;
|
public $orientation;
|
||||||
public $acceptedMimes = [
|
public $acceptedMimes = [
|
||||||
'image/png',
|
'image/png',
|
||||||
'image/jpeg',
|
'image/jpeg'
|
||||||
];
|
];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
@ -114,9 +114,11 @@ class Image
|
||||||
if($thumbnail) {
|
if($thumbnail) {
|
||||||
$img->crop($aspect['width'], $aspect['height']);
|
$img->crop($aspect['width'], $aspect['height']);
|
||||||
} else {
|
} else {
|
||||||
|
$metadata = $img->exif();
|
||||||
$img->resize($aspect['width'], $aspect['height'], function ($constraint) {
|
$img->resize($aspect['width'], $aspect['height'], function ($constraint) {
|
||||||
$constraint->aspectRatio();
|
$constraint->aspectRatio();
|
||||||
});
|
});
|
||||||
|
$media->metadata = json_encode($metadata);
|
||||||
}
|
}
|
||||||
$converted = $this->setBaseName($path, $thumbnail, $img->extension);
|
$converted = $this->setBaseName($path, $thumbnail, $img->extension);
|
||||||
$newPath = storage_path('app/'.$converted['path']);
|
$newPath = storage_path('app/'.$converted['path']);
|
||||||
|
|
Loading…
Reference in a new issue