aboutsummaryrefslogtreecommitdiffstats
path: root/mod/profile_photo.php
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-06-08 23:58:46 -0400
committerSimon L'nu <simon.lnu@gmail.com>2012-06-08 23:58:46 -0400
commit62e9047b8d1b7f3272213a6407db34c9cd1a2cbb (patch)
treeba25995ec05d1df8632731f0da341736d47ce526 /mod/profile_photo.php
parent5bb4a5912b09f6c37e8543a6ff78949a2b5b8cd5 (diff)
parentea4515aca9318429a0b859eb8b45584b382928b3 (diff)
downloadvolse-hubzilla-62e9047b8d1b7f3272213a6407db34c9cd1a2cbb.tar.gz
volse-hubzilla-62e9047b8d1b7f3272213a6407db34c9cd1a2cbb.tar.bz2
volse-hubzilla-62e9047b8d1b7f3272213a6407db34c9cd1a2cbb.zip
Merge remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: (21 commits) more logging on pubsub callbacks provide ability to autofriend ostatus accounts ostatus hub subscription issues better events-reminder theming png support for embedded private photos rev update png support: update database.sql, fix some typos, fix tinymce image browser Add support for PNG images with alpha fix a random profile error message events: fix select events query select events that starts before display start date and/or ends after display end date. more logging on subscribe_to_hub admin page untranslated strings, remove empty list element for update A few corrections in German translations. rev update set minchars to 2 for PM lookups too set minchars to 2 for contacts search contacts search autocomplete add email probe logging, limit typo check to main addon files and skip additional support files rev update named anchors on display page ...
Diffstat (limited to 'mod/profile_photo.php')
-rw-r--r--mod/profile_photo.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index ace8dadd4..e44707f9b 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -53,7 +53,7 @@ function profile_photo_post(&$a) {
$base_image = $r[0];
- $im = new Photo($base_image['data']);
+ $im = new Photo($base_image['data'], $base_image['type']);
if($im->is_valid()) {
$im->cropImage(175,$srcX,$srcY,$srcW,$srcH);
@@ -108,7 +108,9 @@ function profile_photo_post(&$a) {
$src = $_FILES['userfile']['tmp_name'];
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
-
+ $filetype = $_FILES['userfile']['type'];
+ if ($filetype=="") $filetype=guess_image_type($filename);
+
$maximagesize = get_config('system','maximagesize');
if(($maximagesize) && ($filesize > $maximagesize)) {
@@ -118,7 +120,7 @@ function profile_photo_post(&$a) {
}
$imagedata = @file_get_contents($src);
- $ph = new Photo($imagedata);
+ $ph = new Photo($imagedata, $filetype);
if(! $ph->is_valid()) {
notice( t('Unable to process image.') . EOL );
@@ -193,7 +195,7 @@ function profile_photo_content(&$a) {
goaway($a->get_baseurl() . '/profiles');
return; // NOTREACHED
}
- $ph = new Photo($r[0]['data']);
+ $ph = new Photo($r[0]['data'], $r[0]['type']);
profile_photo_crop_ui_head($a, $ph);
// go ahead as we have jus uploaded a new photo to crop
}
@@ -214,7 +216,7 @@ function profile_photo_content(&$a) {
return $o;
}
else {
- $filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.jpg';
+ $filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.'.$a->config['imagecrop_ext'];
$resolution = $a->config['imagecrop_resolution'];
$tpl = get_markup_template("cropbody.tpl");
$o .= replace_macros($tpl,array(
@@ -268,6 +270,7 @@ function profile_photo_crop_ui_head(&$a, $ph){
$a->config['imagecrop'] = $hash;
$a->config['imagecrop_resolution'] = $smallest;
+ $a->config['imagecrop_ext'] = $ph->getExt();
$a->page['htmlhead'] .= get_markup_template("crophead.tpl");
return;
}}