-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Portrait images moves to bottom left hand side of modal in ios #20
Comments
Currently working through this problem myself. I can move the image and it snaps back into proper place in the middle. I believe it has to do with it calculating x/y before the transform is applied. Reversing the order might fix it. |
I wasn't able to fix it. |
Dang. Gotcha. |
Found the issue. It seams that for some odd reason safari mobile wants to flip width/height on ios. Good times.
I'll post an actual fix/workaround here soon. |
Thank you for your effort. I will look forward to your fix. Looking at Exif data seems unwieldy. What about using the Maybe the |
I've read that correctOrientation sometimes work and other times doesn't so i've been trying to find something that is more reliable. |
So nailed down a fix, but unfortunately its not as glamorous as i would of liked. I realized that exif wasn't getting the actual height/width but still the flipped (width/height) version that safari was providing. Without a lot of device/browser testing I still haven't been able to find a way to programmatically figure out the real height and width. (Without reading the base64 through some image processer like imagemagic and passing back the real values). Then added this function. flipImageDimensions: function(){
var self = this;
self.loadImage().then(function(elem) {
self.imgWidth = elem.naturalHeight;
self.imgHeight = elem.naturalWidth;
self.options.modal.el.querySelector('.jr-crop-img').innerHTML = "";
self.options.modal.el.querySelector('.jr-crop-select').innerHTML = "";
self.options.modal.el.querySelector('.jr-crop-img').appendChild(self.imgSelect = elem.cloneNode());
self.options.modal.el.querySelector('.jr-crop-select').appendChild(self.imgFull = elem.cloneNode());
self.bindHandlers();
self.initImage();
});
}, Added this to the initialize function, to expose the new function to the scope. self.options.flipImageDimensions = this.flipImageDimensions.bind(this); Then added this to the template variable: '<button class="button button-clear" ng-click="flipImageDimensions()">Image issues? Click here to try and fix.</button> ' + Again its not ideal, but it does fix the view issues. Its still flipping the image upon cropping, so need to nail that down. But this should be a good place to start for folks. |
i have the same problem large image portrait it not appear at center it appears at bottom left |
Im actually getting this exact error, I think with the ideas given here I'll try to fix the plugin.…… |
I'm glad you made this plugin, it saved me a lot of time. It works perfectly fine in android but in ios, portrait images show in bottom left corner. If I uses a square image it shows properly. Any suggestions?
The text was updated successfully, but these errors were encountered: