You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.
I'm using this module just for fetching the width and height of stored images in my parse server.
I've noticed there are times that the width and height are fetched in reverse, meaning the width is the actual height and the height is the actual width!
Here's the function I'm calling inside an afterSave trigger:
var storeImageDimensions = function(postObject) {
var imageFile = postObject.get("imageLowQuality");
Parse.Cloud.httpRequest({
url: imageFile.url(),
success: function(response) {
// The file contents are in response.buffer.
var Image = require("parse-image");
var image = new Image();
// ----------------------------------
image.setData(response.buffer, {
success: function() {
var imageDimensions = {};
imageDimensions.width = image.width();
imageDimensions.height = image.height();
// ----------------------------------
postObject.set("imageDimensions", imageDimensions);
postObject.save(null, {useMasterKey: true});
},
error: function(error) {
// The image data was invalid.
}
})
},
error: function(error) {
// The networking request failed.
}
});
}
Any idea why's that happening?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm using this module just for fetching the width and height of stored images in my parse server.
I've noticed there are times that the width and height are fetched in reverse, meaning the width is the actual height and the height is the actual width!
Here's the function I'm calling inside an
afterSave
trigger:Any idea why's that happening?
The text was updated successfully, but these errors were encountered: