1
0
Fork 0

Support Blurhash

This commit is contained in:
Michael 2022-12-04 13:29:21 +00:00
commit a5be5b27e3
16 changed files with 152 additions and 17 deletions

View file

@ -94,7 +94,7 @@ class Attachment extends BaseFactory
*/
public function createFromPhoto(int $id): array
{
$photo = Photo::selectFirst(['resource-id', 'uid', 'id', 'title', 'type', 'width', 'height'], ['id' => $id]);
$photo = Photo::selectFirst(['resource-id', 'uid', 'id', 'title', 'type', 'width', 'height', 'blurhash'], ['id' => $id]);
if (empty($photo)) {
return [];
}
@ -104,6 +104,7 @@ class Attachment extends BaseFactory
'description' => $photo['title'],
'width' => $photo['width'],
'height' => $photo['height'],
'blurhash' => $photo['blurhash'],
];
$photoTypes = Images::supportedTypes();

View file

@ -74,6 +74,7 @@ class Card extends BaseFactory
$data['image'] = $attached['preview'];
$data['width'] = $attached['preview-width'];
$data['height'] = $attached['preview-height'];
$data['blurhash'] = $attached['blurhash'];
}
}