issues with private photos - hitting internal size limits

This commit is contained in:
Friendika 2011-05-04 02:20:44 -07:00
parent 64a7d0b578
commit 59fd70e568
11 changed files with 32 additions and 10 deletions

View file

@ -1,6 +1,7 @@
<?php <?php
set_time_limit(0); set_time_limit(0);
ini_set('pcre.backtrack_limit', 250000);
define ( 'FRIENDIKA_VERSION', '2.1.968' ); define ( 'FRIENDIKA_VERSION', '2.1.968' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
@ -9,7 +10,17 @@ define ( 'DB_UPDATE_VERSION', 1054 );
define ( 'EOL', "<br />\r\n" ); define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
define ( 'DOWN_ARROW', '&#x21e9;' ); 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 * SSL redirection policies

View file

@ -38,7 +38,7 @@ $a->config['admin_email'] = '';
// Maximum size of an imported message, 0 is unlimited // 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 // maximum size of uploaded photos

View file

@ -162,12 +162,20 @@ class Photo {
} }
public function saveImage($path) { 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() { public function imageString() {
ob_start(); 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(); $s = ob_get_contents();
ob_end_clean(); ob_end_clean();
return $s; return $s;

View file

@ -701,6 +701,7 @@ function item_store($arr,$force_parent = false) {
$parent_id = 0; $parent_id = 0;
$arr['thr-parent'] = $arr['parent-uri']; $arr['thr-parent'] = $arr['parent-uri'];
$arr['parent-uri'] = $arr['uri']; $arr['parent-uri'] = $arr['uri'];
$arr['gravity'] = 0;
} }
else { else {
logger('item_store: item parent was not found - ignoring item'); logger('item_store: item parent was not found - ignoring item');

View file

@ -1,5 +1,7 @@
<?php <?php
error_reporting(E_ERROR | E_WARNING | E_PARSE); error_reporting(E_ERROR | E_WARNING | E_PARSE);
/** /**
* *
* Friendika * Friendika

View file

@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
// Maximum size of an imported message, 0 is unlimited // 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 // maximum size of uploaded photos

View file

@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
// Maximum size of an imported message, 0 is unlimited // 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 // maximum size of uploaded photos

View file

@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
// Maximum size of an imported message, 0 is unlimited // 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 // maximum size of uploaded photos

View file

@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
// Maximum size of an imported message, 0 is unlimited // 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 // maximum size of uploaded photos

View file

@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
// Maximum size of an imported message, 0 is unlimited // 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 // maximum size of uploaded photos

View file

@ -37,7 +37,7 @@ $a->config['admin_email'] = '';
// Maximum size of an imported message, 0 is unlimited // 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 // maximum size of uploaded photos