-
Notifications
You must be signed in to change notification settings - Fork 883
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
Base64/Canvas Result Cutting off Right Edge #247
Comments
Looks like I've narrowed down the issue to lines 976 - 992 of croppie.js. The stuff that starts with
If that's commented out, seems to work fine again. |
Sorry for the delay - Thanks for the very detailed description. I think the code you're referring to is new. The problem is, Chrome and firefox are fine with I'm trying to replicate the error that you're getting with the images on the demo site, and I can't get it to happen (even when dragging the image to the left). Any thoughts on that? |
hey @thedustinsmith , so I've been trying to extract out the code from our codebase to get exactly what I was experiencing, but am actually having issues reproducing outside of our codebase. I will look into it more to see if it's maybe just something we're doing on our side. We're using croppie with React, and maybe there are some issues with passing the data around. |
@caseyli I commented out those 4 if statements and it seems to have worked. For me, I only had that missing image data if I rotated the image. |
did any one find a solustion |
@chadidi I found someone face this problem http://stackoverflow.com/questions/36565998/drawimage-show-blank-when-capture-size-over-source-image-in-safari |
@bellsenawat the code in stackoverflow is the same at this plugin at line 976 |
@chadidi I dont think so,
and
|
@bellsenawat i changed variables to this and still the same
|
@chadidi yes me too, did you get undefined from self._originalImageWidth and self._originalImageHeight variable ??? I get it and i change it to this.elements.preview.width and this.elements.preview.height but still the same |
@bellsenawat no i didn't get undefined using both of them what size is your images i am usin smal size |
If anyone can put together a codepen/fiddle/jsbin demonstrating the issue, I'm sure we can get it fixed. The lines you guys are referring to were implemented to fix a IE and a safari bug with drawing image data outside of the boundaries of the image. I can try to use the code from the stack overflow post, but they "abort" the operation, which I'd like to avoid, if possible. |
@thedustinsmith I will to upload my code to fiddle, by the way I use this lib with angular.js project, i am not sure the problem came from angular or this lib. |
@bellsenawat i am sure it's from the library in my case some images crop just fine and some are not and this is my |
@bellsenawat when i set |
@chadidi I have to set false because i need user can zoom out image and can replace image as they want in any place of canvas, so its work perfect for chrome version 2.2, After that I found its show blank image and i update lib to 2.4 it worse for chrome and safari :( |
@bellsenawat test it with |
did any one found a solution |
@chadidi did you found a solution ? |
@thedustinsmith sorry for late reply, I test on demo and it happen like this issue |
@thedustinsmith Could you test your demo like my previous post ? I think its a problem :( |
@bellsenawat Thanks for the detailed steps. This time of year is really busy for us, so I'll get to it as soon as I can. It just might be a while. Sorry :( |
Alright, I've got a potential fix in master, but I could really use a lot more eyes on it. Does the code in master solve everyone's issue? Does it break anyone's issue they weren't having before? |
Also, I only saw the issue when I had the |
Fixed in 2.4.1 |
@maxklenk - It seems to be working for me with circles. Can you put together something that demonstrates the issue you're having? |
Sure, please try this demo. To reproduce the behavior shown in the screenshot select an area greater than the original image and press the button: |
Thanks for the demo - seems like it's the combo of a circle and an image smaller than the viewport. |
I'm having the same issue. Sometimes the image is complete, sometimes the image is black or sometimes is incomplete. HTML code:
|
After discovering Croppie & implementing it into my CMS, I kept finding a strange bug regarding the viewport that I could never get around, but the fix above sorted that for me and now it works fine! This was regardless of what I set |
Does this issue still exist? @jdrydn What "fix" were you referring to exactly? |
@AdityaAnand1 See this commit from this fork (referenced above my comment) - commenting out a section of code literally fixed this issue. I haven't looked into this further after "implementing" this "fix", so I have no idea if later commits & PRs merged into this repo sorted this bug. |
This is out of hand. I'm closing this issue. If anyone's problem persists in 2.5.2, let's address it in another issue. |
@thedustinsmith I'm sure future users who stumble onto this issue would appreciate a less ambiguous conclusion that "This is out of hand". 😄
|
@AdityaAnand1 Why don't you let everyone know if the issue is fixed in this branch: https://github.com/Foliotek/Croppie/tree/pre-2.5.2 |
I'm running into an issue with the latest build of croppie.js. (as in, it only started happening with the new build - seemed to not have this issue in a previous build).
It seems to only happen when I drag the image to the left (leaving empty space to the right of the image). When I get the 'canvas' / 'base64' result (without any other arguments) and assign it to an image tag src as a preview, it seems to cut off some pixels.
Here's what it looks like in croppie:
And then when I get the result and preview it:
If I drag the image to the right (leaving empty space on the left), it doesn't happen:
Croppie:
and everything works fine:
What seems consistent with the problem is that if I specify a height and width when calling "result()", it squashes the image into that cut off area.
Again, this only happens when dragging the image to the left.
Is anybody else seeing this issue?
The text was updated successfully, but these errors were encountered: