Created
November 13, 2013 09:11
-
-
Save Prinzhorn/7446018 to your computer and use it in GitHub Desktop.
FileAPI upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Not working: | |
FileAPI.upload({ | |
url: '/upload', | |
files: { | |
image: FileAPI.Image(file).resize(800, 800, 'min') | |
} | |
}); | |
//Working fine: | |
FileAPI.upload({ | |
url: '/upload', | |
files: { | |
image: file | |
} | |
}); |
1.2.6 — not supported FileAPI.Image uploading, only 2+, but:
FileAPI.upload({
url: '/upload',
files: {
image: file
},
imageTransform: {
width: 800,
height: 800,
type: 'min'
}
});
Great, works!
The documentation about imageTransform
doesn't mention all these options.
Also the changelog of 2.0.0 is lacking some important details then.
Also: does imageTransform
support auto orientation? Because the exif is destroyed, I can't rotate it server side anymore.
Yes, you're right. I try to improve documentation, but time is against me:]
https://github.com/mailru/FileAPI/tree/dev#imagetransformobject
So or imageAutoOrientation: true
:
FileAPI.upload({
url: '/upload',
files: { image: file },
imageTransform: {
width: 800,
height: 800,
type: 'min',
rotate: 'auto' // so
}
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1.2.6