]> git.mxchange.org Git - friendica.git/commitdiff
issues with private photos - hitting internal size limits
authorFriendika <info@friendika.com>
Wed, 4 May 2011 09:20:44 +0000 (02:20 -0700)
committerFriendika <info@friendika.com>
Wed, 4 May 2011 09:20:44 +0000 (02:20 -0700)
boot.php
htconfig.php
include/Photo.php
include/items.php
index.php
view/de/htconfig.tpl
view/en/htconfig.tpl
view/es/htconfig.tpl
view/fr/htconfig.tpl
view/it/htconfig.tpl
view/sv/htconfig.tpl

index 6479868b3b024836f5a1e3edff649d32a57a4146..263d76f62042015f6f6c673b93a344db7e564aa7 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1,6 +1,7 @@
 <?php
 
 set_time_limit(0);
+ini_set('pcre.backtrack_limit', 250000);
 
 define ( 'FRIENDIKA_VERSION',      '2.1.968' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
@@ -9,7 +10,17 @@ define ( 'DB_UPDATE_VERSION',      1054      );
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
 define ( 'DOWN_ARROW',             '&#x21e9;'       );
-         
+
+/**
+ *
+ * Image storage quality. Lower numbers save space at cost of image detail.
+ * For ease of upgrade, please do not change here. Change jpeg quality with 
+ * set_config('system','jpeg_quality',n) in .htconfig.php
+ * where n is netween 1 and 100, and with very poor results below about 50 
+ *
+ */
+
+define ( 'JPEG_QUALITY',            100              );         
 
 /**
  * SSL redirection policies
index fb62245d210eed7b83d707b1f604c1241b1c2bcf..0f9222ac59d00845e24f6528a9c4f24a21d8bf50 100644 (file)
@@ -38,7 +38,7 @@ $a->config['admin_email'] = '';
 
 // Maximum size of an imported message, 0 is unlimited
 
-$a->config['max_import_size'] = 10000;
+$a->config['max_import_size'] = 200000;
 
 // maximum size of uploaded photos
 
index 9934b9a3928f2e79ec060ede1cb55f547718f4ef..707b0de5d8c3af8ea8ac849690ad644fb8180fae 100644 (file)
@@ -162,12 +162,20 @@ class Photo {
        }
 
        public function saveImage($path) {
-               imagejpeg($this->image,$path,100);
+               $quality = get_config('system','jpeg_quality');
+               if((! $quality) || ($quality > 100))
+                       $quality = JPEG_QUALITY;
+               imagejpeg($this->image,$path,$quality);
        }
 
        public function imageString() {
                ob_start();
-               imagejpeg($this->image,NULL,100);
+
+               $quality = get_config('system','jpeg_quality');
+               if((! $quality) || ($quality > 100))
+                       $quality = JPEG_QUALITY;
+
+               imagejpeg($this->image,NULL,$quality);
                $s = ob_get_contents();
                ob_end_clean();
                return $s;
index c5ecac777193bdde07d78d44e58929965a540b68..3a3085f1b053f4312f899e8ba011a76f313b804f 100644 (file)
@@ -701,6 +701,7 @@ function item_store($arr,$force_parent = false) {
                                $parent_id = 0;
                                $arr['thr-parent'] = $arr['parent-uri'];
                                $arr['parent-uri'] = $arr['uri'];
+                               $arr['gravity'] = 0;
                        }
                        else {
                                logger('item_store: item parent was not found - ignoring item');
index 074c1c53a4452e2fe63f65319bbfe96c39e900ae..05eef6c6e0bfe0f2e7475b29798ff96866702e6d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,5 +1,7 @@
 <?php
+
 error_reporting(E_ERROR | E_WARNING | E_PARSE);
+
 /**
  *
  * Friendika
index d3bb6b411e3b047a79a86b791c5caeab66bdf400..0ce28b4a06693d19795e3a29f8c4c8b59f157722 100644 (file)
@@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
 
 // Maximum size of an imported message, 0 is unlimited
 
-$a->config['max_import_size'] = 10000;
+$a->config['max_import_size'] = 200000;
 
 // maximum size of uploaded photos
 
index d3bb6b411e3b047a79a86b791c5caeab66bdf400..0ce28b4a06693d19795e3a29f8c4c8b59f157722 100644 (file)
@@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
 
 // Maximum size of an imported message, 0 is unlimited
 
-$a->config['max_import_size'] = 10000;
+$a->config['max_import_size'] = 200000;
 
 // maximum size of uploaded photos
 
index 180f7885ccaeb572bd29bbfdedabe6c2870a4ae6..4de26611296604110b65e109dca88aa2c3e3db8a 100644 (file)
@@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
 
 // Maximum size of an imported message, 0 is unlimited
 
-$a->config['max_import_size'] = 10000;
+$a->config['max_import_size'] = 200000;
 
 // maximum size of uploaded photos
 
index d31d5a39ff2a4606a230806daf7cc2e32829c12c..c65114a68a413d6bfe6538139a04664912632044 100644 (file)
@@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
 
 // Maximum size of an imported message, 0 is unlimited
 
-$a->config['max_import_size'] = 10000;
+$a->config['max_import_size'] = 200000;
 
 // maximum size of uploaded photos
 
index 180f7885ccaeb572bd29bbfdedabe6c2870a4ae6..4de26611296604110b65e109dca88aa2c3e3db8a 100644 (file)
@@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
 
 // Maximum size of an imported message, 0 is unlimited
 
-$a->config['max_import_size'] = 10000;
+$a->config['max_import_size'] = 200000;
 
 // maximum size of uploaded photos
 
index d3bb6b411e3b047a79a86b791c5caeab66bdf400..0ce28b4a06693d19795e3a29f8c4c8b59f157722 100644 (file)
@@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
 
 // Maximum size of an imported message, 0 is unlimited
 
-$a->config['max_import_size'] = 10000;
+$a->config['max_import_size'] = 200000;
 
 // maximum size of uploaded photos