When trying to create thumbnails for remote media that don't have the
filename field set, we got a lot of output in the debug log.
$imgPath = null;
$media = common_get_mime_media($file->mimetype);
if (Event::handle('CreateFileImageThumbnailSource', array($file, &$imgPath, $media))) {
+ if (empty($file->filename)) {
+ throw new UnsupportedMediaException(_('File without filename could not get a thumbnail source.'));
+ }
switch ($media) {
case 'image':
$imgPath = $file->getPath();