]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add attachments 'thumb_width' and 'thumb_height' settings for inline thumbs, defaulti...
authorBrion Vibber <brion@status.net>
Tue, 9 Nov 2010 01:36:02 +0000 (17:36 -0800)
committerBrion Vibber <brion@status.net>
Tue, 9 Nov 2010 01:36:02 +0000 (17:36 -0800)
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).

classes/File_oembed.php
lib/default.php
lib/mediafile.php

index 4813d5dda52e8709fde611ba7deb48726959ab8d..a5540ecfee5de54f87b2c323feaba82f624c9e9b 100644 (file)
@@ -58,11 +58,11 @@ class File_oembed extends Memcached_DataObject
         return array(false, false, false);
     }
 
-    function _getOembed($url, $maxwidth = 500, $maxheight = 400) {
+    function _getOembed($url) {
         require_once INSTALLDIR.'/extlib/Services/oEmbed.php';
         $parameters = array(
-            'maxwidth'=>$maxwidth,
-            'maxheight'=>$maxheight,
+            'maxwidth' => common_config('attachments', 'thumb_width'),
+            'maxheight' => common_config('attachments', 'thumb_height'),
         );
         try{
             $oEmbed = new Services_oEmbed($url);
index a19453fce49ddb3ec2edcd61f78e42f9220b395f..87f4e45c0e27ff2e8a16f956e294b9191071356d 100644 (file)
@@ -250,6 +250,8 @@ $default =
               'monthly_quota' => 15000000,
               'uploads' => true,
               'filecommand' => '/usr/bin/file',
+              'thumb_width' => 100,
+              'thumb_height' => 75,
               ),
         'application' =>
         array('desclimit' => null),
index 2c04b46501652cb42196663480f46986542c5964..febf4603a7046d3448aab2edad2d0882990a28b9 100644 (file)
@@ -127,8 +127,8 @@ class MediaFile
         $outname = File::filename($this->user->getProfile(), 'thumb-' . $this->filename, $this->mimetype);
         $outpath = File::path($outname);
 
-        $width = 100;
-        $height = 75;
+        $width = common_config('attachments', 'thumb_width');
+        $height = common_config('attachments', 'thumb_height');
 
         $image->resizeTo($outpath, $width, $height);
         File_thumbnail::saveThumbnail($this->fileRecord->id,