fix picture orientation
This commit is contained in:
@@ -145,7 +145,7 @@ class Picture extends PhpObject {
|
||||
$sPicPath = self::getPicPath($sPicName);
|
||||
$sThumbPath = self::getPicPath($sPicName, 'thumbnail');
|
||||
|
||||
if(!file_exists($sThumbPath)) $asThumbInfo = ToolBox::createThumbnail($sPicPath, 400, 0, $sThumbPath/*, false, array('jpg', 'jpeg', 'gif', 'png'), true*/);
|
||||
if(!file_exists($sThumbPath)) $asThumbInfo = ToolBox::createThumbnail($sPicPath, 400, 0, $sThumbPath, false, array('jpg', 'jpeg', 'gif', 'png'), false, true);
|
||||
else $asThumbInfo = array('error'=>'', 'out'=>$sThumbPath);
|
||||
|
||||
return ($asThumbInfo['error']=='')?$asThumbInfo['out']:$sPicPath;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="mobile" class="mobile"></div>
|
||||
<script type="text/javascript" src="script/lightbox.min.js"></script>
|
||||
<script type="text/javascript" src="script/lightbox.js"></script>
|
||||
<script type="text/javascript">
|
||||
oSpot.onSamePageMove = function(asHash) {
|
||||
if(self.tmp('first_exec')) initPage(asHash);
|
||||
@@ -449,8 +449,8 @@ function getPost(asPost) {
|
||||
break;
|
||||
case 'picture':
|
||||
var sTakenOn = (asPost.taken_on == '0000-00-00 00:00:00')?'':' et prise le '+asPost.taken_on_formatted+self.tmp('site_tz_notice');
|
||||
var $Image = $('<img>', {'src': asPost.thumb_path, title: 'Click pour zoomer'/*, 'style':'transform:rotate('+asPost.rotate+'deg);'*/});
|
||||
$Body = $('<a>', {href: asPost.pic_path, 'data-lightbox': 'post-pictures', 'data-title': 'Photo ajoutée le '+sAbsTime+sTakenOn}).append($Image);
|
||||
var $Image = $('<img>', {'src': asPost.thumb_path, title: 'Click pour zoomer'});
|
||||
$Body = $('<a>', {href: asPost.pic_path, 'data-lightbox': 'post-pictures', 'data-title': 'Photo ajoutée le '+sAbsTime+sTakenOn, 'data-orientation': asPost.rotate}).append($Image);
|
||||
break;
|
||||
case 'post':
|
||||
$Body = $('<div>')
|
||||
|
||||
@@ -215,6 +215,9 @@
|
||||
alt: $link.attr('data-alt'),
|
||||
link: $link.attr('href'),
|
||||
title: $link.attr('data-title') || $link.attr('title')
|
||||
//ADDED-START
|
||||
, orientation: $link.attr('data-orientation')
|
||||
//ADDED-END
|
||||
});
|
||||
}
|
||||
|
||||
@@ -293,6 +296,14 @@
|
||||
});
|
||||
|
||||
$preloader = $(preloader);
|
||||
|
||||
//ADDED-START
|
||||
if(Math.abs(self.album[imageNumber].orientation) == 90) {
|
||||
var sWidth = preloader.width;
|
||||
preloader.width = preloader.height;
|
||||
preloader.height = sWidth;
|
||||
}
|
||||
//ADDED-END
|
||||
|
||||
$image.width(preloader.width);
|
||||
$image.height(preloader.height);
|
||||
|
||||
@@ -39,4 +39,8 @@
|
||||
|
||||
.lb-data .lb-close {
|
||||
@include lightbox-icon(close);
|
||||
}
|
||||
|
||||
.lb-image {
|
||||
image-orientation: from-image;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user