fix picture orientation
This commit is contained in:
@@ -145,7 +145,7 @@ class Picture extends PhpObject {
|
|||||||
$sPicPath = self::getPicPath($sPicName);
|
$sPicPath = self::getPicPath($sPicName);
|
||||||
$sThumbPath = self::getPicPath($sPicName, 'thumbnail');
|
$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);
|
else $asThumbInfo = array('error'=>'', 'out'=>$sThumbPath);
|
||||||
|
|
||||||
return ($asThumbInfo['error']=='')?$asThumbInfo['out']:$sPicPath;
|
return ($asThumbInfo['error']=='')?$asThumbInfo['out']:$sPicPath;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="mobile" class="mobile"></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">
|
<script type="text/javascript">
|
||||||
oSpot.onSamePageMove = function(asHash) {
|
oSpot.onSamePageMove = function(asHash) {
|
||||||
if(self.tmp('first_exec')) initPage(asHash);
|
if(self.tmp('first_exec')) initPage(asHash);
|
||||||
@@ -449,8 +449,8 @@ function getPost(asPost) {
|
|||||||
break;
|
break;
|
||||||
case 'picture':
|
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 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);'*/});
|
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}).append($Image);
|
$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;
|
break;
|
||||||
case 'post':
|
case 'post':
|
||||||
$Body = $('<div>')
|
$Body = $('<div>')
|
||||||
|
|||||||
@@ -215,6 +215,9 @@
|
|||||||
alt: $link.attr('data-alt'),
|
alt: $link.attr('data-alt'),
|
||||||
link: $link.attr('href'),
|
link: $link.attr('href'),
|
||||||
title: $link.attr('data-title') || $link.attr('title')
|
title: $link.attr('data-title') || $link.attr('title')
|
||||||
|
//ADDED-START
|
||||||
|
, orientation: $link.attr('data-orientation')
|
||||||
|
//ADDED-END
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,6 +296,14 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$preloader = $(preloader);
|
$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.width(preloader.width);
|
||||||
$image.height(preloader.height);
|
$image.height(preloader.height);
|
||||||
|
|||||||
@@ -39,4 +39,8 @@
|
|||||||
|
|
||||||
.lb-data .lb-close {
|
.lb-data .lb-close {
|
||||||
@include lightbox-icon(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