diff options
author | Vasudev Kamath <kamathvasudev@gmail.com> | 2012-06-23 08:11:35 +0530 |
---|---|---|
committer | Vasudev Kamath <kamathvasudev@gmail.com> | 2012-06-23 08:11:35 +0530 |
commit | 6e4760dd9c512147309b5e4a98d25216610f81da (patch) | |
tree | cd1ea2edf6b257e52ab8fd10c781ba600d884506 /mod/photos.php | |
parent | 11974b4d948ae5d9b9fb53970838463bd88bb9f6 (diff) | |
parent | 4e7eb36dd1e65bf481ffe30614565674cbef4fe5 (diff) | |
download | volse-hubzilla-6e4760dd9c512147309b5e4a98d25216610f81da.tar.gz volse-hubzilla-6e4760dd9c512147309b5e4a98d25216610f81da.tar.bz2 volse-hubzilla-6e4760dd9c512147309b5e4a98d25216610f81da.zip |
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/photos.php')
-rw-r--r-- | mod/photos.php | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/mod/photos.php b/mod/photos.php index efeab8fa3..d96bc135e 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -36,7 +36,7 @@ function photos_init(&$a) { $o .= '<div class="vcard">'; $o .= '<div class="fn">' . $a->data['user']['username'] . '</div>'; - $o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg" alt="' . $a->data['user']['username'] . '" /></div>'; + $o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg') . '" alt="' . $a->data['user']['username'] . '" /></div>'; $o .= '</div>'; if(! intval($a->data['user']['hidewall'])) { @@ -306,7 +306,8 @@ function photos_post(&$a) { $albname = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y'); - if((x($_POST,'rotate') !== false) && (intval($_POST['rotate']) == 1)) { + if((x($_POST,'rotate') !== false) && + ( (intval($_POST['rotate']) == 1) || (intval($_POST['rotate']) == 2) )) { logger('rotate'); $r = q("select * from photo where `resource-id` = '%s' and uid = %d and scale = 0 limit 1", @@ -316,7 +317,8 @@ function photos_post(&$a) { if(count($r)) { $ph = new Photo($r[0]['data'], $r[0]['type']); if($ph->is_valid()) { - $ph->rotate(270); + $rotate_deg = ( (intval($_POST['rotate']) == 1) ? 270 : 90 ); + $ph->rotate($rotate_deg); $width = $ph->getWidth(); $height = $ph->getHeight(); @@ -325,8 +327,8 @@ function photos_post(&$a) { dbesc($ph->imageString()), intval($height), intval($width), - dbesc($resource_id), - intval($page_owner_uid) + dbesc($resource_id), + intval($page_owner_uid) ); if($width > 640 || $height > 640) { @@ -338,8 +340,8 @@ function photos_post(&$a) { dbesc($ph->imageString()), intval($height), intval($width), - dbesc($resource_id), - intval($page_owner_uid) + dbesc($resource_id), + intval($page_owner_uid) ); } @@ -352,8 +354,8 @@ function photos_post(&$a) { dbesc($ph->imageString()), intval($height), intval($width), - dbesc($resource_id), - intval($page_owner_uid) + dbesc($resource_id), + intval($page_owner_uid) ); } } @@ -718,6 +720,7 @@ function photos_post(&$a) { killme(); } + $ph->orient($src); @unlink($src); $width = $ph->getWidth(); @@ -1250,7 +1253,8 @@ function photos_content(&$a) { $edit_tpl = get_markup_template('photo_edit.tpl'); $edit = replace_macros($edit_tpl, array( '$id' => $ph[0]['id'], - '$rotate' => t('Rotate CW'), + '$rotatecw' => t('Rotate CW (right)'), + '$rotateccw' => t('Rotate CCW (left)'), '$album' => template_escape($ph[0]['album']), '$newalbum' => t('New album name'), '$nickname' => $a->data['user']['nickname'], |