mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Add new config
This commit is contained in:
parent
36e15a52e4
commit
25d632c761
2 changed files with 28 additions and 9 deletions
|
@ -116,11 +116,14 @@ class Image
|
||||||
$constraint->aspectRatio();
|
$constraint->aspectRatio();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
if(config('media.exif.database', false) == true) {
|
||||||
$metadata = $img->exif();
|
$metadata = $img->exif();
|
||||||
|
$media->metadata = json_encode($metadata);
|
||||||
|
}
|
||||||
|
|
||||||
$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']);
|
||||||
|
@ -141,6 +144,7 @@ class Image
|
||||||
}
|
}
|
||||||
|
|
||||||
$media->save();
|
$media->save();
|
||||||
|
Cache::forget('status:transformer:media:attachments:'.$media->status_id);
|
||||||
Cache::forget('status:thumb:'.$media->status_id);
|
Cache::forget('status:thumb:'.$media->status_id);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
}
|
}
|
||||||
|
|
15
config/media.php
Normal file
15
config/media.php
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'exif' => [
|
||||||
|
'database' => env('MEDIA_EXIF_DATABASE', false),
|
||||||
|
'strip' => true
|
||||||
|
],
|
||||||
|
'types' => env('MEDIA_TYPES', 'image/jpeg,image/png,image/gif'),
|
||||||
|
'photo' => [
|
||||||
|
'optimize' => env('PF_OPTIMIZE_IMAGES', true),
|
||||||
|
'quality' => (int) env('IMAGE_QUALITY', 80),
|
||||||
|
'max_size' => env('MAX_PHOTO_SIZE', 15000),
|
||||||
|
'max_album_length' => env('MAX_ALBUM_LENGTH', 4),
|
||||||
|
],
|
||||||
|
];
|
Loading…
Reference in a new issue