Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -6171,7 +6171,7 @@ define("moxie/image/Image", [
|
||||
srcRect.x = Math.max(srcRect.x, 0);
|
||||
srcRect.y = Math.max(srcRect.y, 0);
|
||||
} else {
|
||||
scale = Math.min(opts.width/self.width, opts.height/self.height);
|
||||
scale = Math.min(1,opts.width/self.width, opts.height/self.height);
|
||||
}
|
||||
|
||||
this.exec('Image', 'resize', srcRect, scale, opts);
|
||||
@@ -9255,10 +9255,30 @@ define("moxie/runtime/html5/image/Image", [
|
||||
_canvas = ResizerCanvas.scale(canvas, ratio);
|
||||
|
||||
_preserveHeaders = options.preserveHeaders;
|
||||
|
||||
// Some browsers will draw the image with the correct orientation (Firefox) and some don't (Safari, Chrome)
|
||||
// This tries to detect if the orientation is wrong so that we can reverse it
|
||||
var browserHasAlreadyRotated = ( this.meta && this.meta.exif && this.meta.exif.PixelXDimension == rect.height );
|
||||
|
||||
// rotate if required, according to orientation tag
|
||||
if (!_preserveHeaders) {
|
||||
if (!_preserveHeaders || browserHasAlreadyRotated) {
|
||||
var orientation = (this.meta && this.meta.tiff && this.meta.tiff.Orientation) || 1;
|
||||
if ( browserHasAlreadyRotated ) {
|
||||
switch ( orientation ) {
|
||||
case 6:
|
||||
orientation = 8;
|
||||
break;
|
||||
case 8:
|
||||
orientation = 6;
|
||||
break;
|
||||
case 5:
|
||||
orientation = 7;
|
||||
break;
|
||||
case 7:
|
||||
orientation = 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
_canvas = _rotateToOrientaion(_canvas, orientation);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user