forked from GNUsocial/gnu-social
[ImageEncoder] Move DB::persist call to AttachmentThumbnail
This commit is contained in:
parent
a33a25983e
commit
c37a75cf7b
@ -129,6 +129,8 @@ class AttachmentThumbnail extends Entity
|
|||||||
$major_mime = GSFile::mimetypeMajor($attachment->getMimetype());
|
$major_mime = GSFile::mimetypeMajor($attachment->getMimetype());
|
||||||
if (in_array($major_mime, array_keys($event_map))) {
|
if (in_array($major_mime, array_keys($event_map))) {
|
||||||
Event::handle($event_map[$major_mime], [$attachment, $thumbnail, $width, $height, $crop]);
|
Event::handle($event_map[$major_mime], [$attachment, $thumbnail, $width, $height, $crop]);
|
||||||
|
DB::persist($thumbnail);
|
||||||
|
DB::flush();
|
||||||
return $thumbnail;
|
return $thumbnail;
|
||||||
} else {
|
} else {
|
||||||
Log::debug($m = ('Cannot resize attachment with mimetype ' . $attachment->getMimetype()));
|
Log::debug($m = ('Cannot resize attachment with mimetype ' . $attachment->getMimetype()));
|
||||||
|
Loading…
Reference in New Issue
Block a user