Dynamically generate thumbnails (see full text)

The File object now stores width and height of files that can
supply this kind of information. Formats which we can not read
natively in PHP do not currently benefit from this. However an
event hook will be introduced later.

The CreateFileImageThumbnail event is renamed to:
CreateFileImageThumbnailSource to clarify that the hooks should not
generate their own thumbnails but only the source image. Also it now
accepts File objects, not MediaFile objects.

The thumbnail generation is documented in the source code. For
developers, call 'getThumbnail' on a File object and hope for the best.

Default thumbnail sizes have increased to be more appealing.
This commit is contained in:
Mikael Nordfeldth
2014-04-21 20:39:28 +02:00
parent 7f3611c51c
commit d59eb5e184
14 changed files with 238 additions and 178 deletions

View File

@@ -69,8 +69,8 @@ class File_oembed extends Managed_DataObject
function _getOembed($url) {
$parameters = array(
'maxwidth' => common_config('attachments', 'thumb_width'),
'maxheight' => common_config('attachments', 'thumb_height'),
'maxwidth' => common_config('thumbnail', 'width'),
'maxheight' => common_config('thumbnail', 'height'),
);
try {
return oEmbedHelper::getObject($url, $parameters);