We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 09de2a17 authored by mattl's avatar mattl

Hack to force thumbnail generation directly on upload

Remove this when we know that third party frontends like Qvitter have
improved attachment handling.
parent 015e9582
......@@ -75,6 +75,17 @@ class ApiMediaUploadAction extends ApiAuthAction
// we could catch "NoUploadedMediaException" as "no media uploaded", but here we _always_ want an upload
$upload = MediaFile::fromUpload('media', $this->scoped);
// Hack to make a thumbnail before giving back a response
// (the file should instead actually be attached to a notice in the file_to_post table)
try {
if ($upload->fileRecord instanceof File) {
} catch (Exception $e) {
common_debug(sprintf('A hack is buggy: MediaFile fileRecord could not getThumbnail for file id==%u',
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment