aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-05-04 02:20:44 -0700
committerFriendika <info@friendika.com>2011-05-04 02:20:44 -0700
commit59fd70e568fbc93922769333c55d8c1fa72cea9d (patch)
tree091e462af7cd7851c6ff3790e47c5e019d2c18bc
parent64a7d0b578ae3264eb65bd4ad1c20a38d63cf3bf (diff)
downloadvolse-hubzilla-59fd70e568fbc93922769333c55d8c1fa72cea9d.tar.gz
volse-hubzilla-59fd70e568fbc93922769333c55d8c1fa72cea9d.tar.bz2
volse-hubzilla-59fd70e568fbc93922769333c55d8c1fa72cea9d.zip
issues with private photos - hitting internal size limits
-rw-r--r--boot.php13
-rw-r--r--htconfig.php2
-rw-r--r--include/Photo.php12
-rw-r--r--include/items.php1
-rw-r--r--index.php2
-rw-r--r--view/de/htconfig.tpl2
-rw-r--r--view/en/htconfig.tpl2
-rw-r--r--view/es/htconfig.tpl2
-rw-r--r--view/fr/htconfig.tpl2
-rw-r--r--view/it/htconfig.tpl2
-rw-r--r--view/sv/htconfig.tpl2
11 files changed, 32 insertions, 10 deletions
diff --git a/boot.php b/boot.php
index 6479868b3..263d76f62 100644
--- 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
diff --git a/htconfig.php b/htconfig.php
index fb62245d2..0f9222ac5 100644
--- a/htconfig.php
+++ b/htconfig.php
@@ -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
diff --git a/include/Photo.php b/include/Photo.php
index 9934b9a39..707b0de5d 100644
--- a/include/Photo.php
+++ b/include/Photo.php
@@ -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;
diff --git a/include/items.php b/include/items.php
index c5ecac777..3a3085f1b 100644
--- a/include/items.php
+++ b/include/items.php
@@ -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');
diff --git a/index.php b/index.php
index 074c1c53a..05eef6c6e 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,7 @@
<?php
+
error_reporting(E_ERROR | E_WARNING | E_PARSE);
+
/**
*
* Friendika
diff --git a/view/de/htconfig.tpl b/view/de/htconfig.tpl
index d3bb6b411..0ce28b4a0 100644
--- a/view/de/htconfig.tpl
+++ b/view/de/htconfig.tpl
@@ -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
diff --git a/view/en/htconfig.tpl b/view/en/htconfig.tpl
index d3bb6b411..0ce28b4a0 100644
--- a/view/en/htconfig.tpl
+++ b/view/en/htconfig.tpl
@@ -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
diff --git a/view/es/htconfig.tpl b/view/es/htconfig.tpl
index 180f7885c..4de266112 100644
--- a/view/es/htconfig.tpl
+++ b/view/es/htconfig.tpl
@@ -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
diff --git a/view/fr/htconfig.tpl b/view/fr/htconfig.tpl
index d31d5a39f..c65114a68 100644
--- a/view/fr/htconfig.tpl
+++ b/view/fr/htconfig.tpl
@@ -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
diff --git a/view/it/htconfig.tpl b/view/it/htconfig.tpl
index 180f7885c..4de266112 100644
--- a/view/it/htconfig.tpl
+++ b/view/it/htconfig.tpl
@@ -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
diff --git a/view/sv/htconfig.tpl b/view/sv/htconfig.tpl
index d3bb6b411..0ce28b4a0 100644
--- a/view/sv/htconfig.tpl
+++ b/view/sv/htconfig.tpl
@@ -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