forked from GNUsocial/gnu-social
Add attachments 'thumb_width' and 'thumb_height' settings for inline thumbs, defaulting to 100x75.
This is used as the max thumb width/height for oEmbed requests (replacing the old default of 500x400 which was more suitable for the lightbox).
This commit is contained in:
parent
6d7f02ff31
commit
694448e0aa
@ -58,11 +58,11 @@ class File_oembed extends Memcached_DataObject
|
|||||||
return array(false, false, false);
|
return array(false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _getOembed($url, $maxwidth = 500, $maxheight = 400) {
|
function _getOembed($url) {
|
||||||
require_once INSTALLDIR.'/extlib/Services/oEmbed.php';
|
require_once INSTALLDIR.'/extlib/Services/oEmbed.php';
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
'maxwidth'=>$maxwidth,
|
'maxwidth' => common_config('attachments', 'thumb_width'),
|
||||||
'maxheight'=>$maxheight,
|
'maxheight' => common_config('attachments', 'thumb_height'),
|
||||||
);
|
);
|
||||||
try{
|
try{
|
||||||
$oEmbed = new Services_oEmbed($url);
|
$oEmbed = new Services_oEmbed($url);
|
||||||
|
@ -250,6 +250,8 @@ $default =
|
|||||||
'monthly_quota' => 15000000,
|
'monthly_quota' => 15000000,
|
||||||
'uploads' => true,
|
'uploads' => true,
|
||||||
'filecommand' => '/usr/bin/file',
|
'filecommand' => '/usr/bin/file',
|
||||||
|
'thumb_width' => 100,
|
||||||
|
'thumb_height' => 75,
|
||||||
),
|
),
|
||||||
'application' =>
|
'application' =>
|
||||||
array('desclimit' => null),
|
array('desclimit' => null),
|
||||||
|
@ -127,8 +127,8 @@ class MediaFile
|
|||||||
$outname = File::filename($this->user->getProfile(), 'thumb-' . $this->filename, $this->mimetype);
|
$outname = File::filename($this->user->getProfile(), 'thumb-' . $this->filename, $this->mimetype);
|
||||||
$outpath = File::path($outname);
|
$outpath = File::path($outname);
|
||||||
|
|
||||||
$width = 100;
|
$width = common_config('attachments', 'thumb_width');
|
||||||
$height = 75;
|
$height = common_config('attachments', 'thumb_height');
|
||||||
|
|
||||||
$image->resizeTo($outpath, $width, $height);
|
$image->resizeTo($outpath, $width, $height);
|
||||||
File_thumbnail::saveThumbnail($this->fileRecord->id,
|
File_thumbnail::saveThumbnail($this->fileRecord->id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user