mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
fixed image copy bug... need to test if this is linux-specific...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
4dad475e8c
commit
7046e88ad8
@ -63,8 +63,15 @@ function({url, orientation, flipped}, callback){
|
||||
|
||||
var img = new Image
|
||||
img.onload = function(){
|
||||
var width = this.naturalWidth
|
||||
var height = this.naturalHeight
|
||||
// XXX .naturalWidth/.naturalHeight seem to ignore .imageOrientation
|
||||
// setting and orient the image via exif while .width/.height
|
||||
// seem to respect it but only when atached to DOM...
|
||||
// XXX for some reason noticed this on Linux, need to test under
|
||||
// Windows if this is a platform-specific thing...
|
||||
//var width = this.naturalWidth
|
||||
//var height = this.naturalHeight
|
||||
var width = this.width
|
||||
var height = this.height
|
||||
|
||||
var c = document.createElement('canvas')
|
||||
c.style.imageOrientation = 'none'
|
||||
@ -76,12 +83,12 @@ function({url, orientation, flipped}, callback){
|
||||
// prepare for rotate...
|
||||
// 90 / 270
|
||||
if(orientation == 90 || orientation == 270){
|
||||
var w = c.width = this.naturalHeight
|
||||
var h = c.height = this.naturalWidth
|
||||
var w = c.width = height
|
||||
var h = c.height = width
|
||||
// 0 / 180
|
||||
} else {
|
||||
var w = c.width = this.naturalWidth
|
||||
var h = c.height = this.naturalHeight }
|
||||
var w = c.width = width
|
||||
var h = c.height = height }
|
||||
// prepare for flip...
|
||||
var x = flipped && flipped.includes('horizontal') ?
|
||||
-1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user