Skip to content
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

Result using original option doesn't return cropped region #409

Closed
yusuf-khamis opened this issue Oct 31, 2017 · 6 comments
Closed

Result using original option doesn't return cropped region #409

yusuf-khamis opened this issue Oct 31, 2017 · 6 comments

Comments

@yusuf-khamis
Copy link

so exactly if you set option size to original instead of viewport it returns the image but cropped from 0,0, sizeY,sizeX of the image dimensions instead of the actual cropped part, is this how its supposed to work because my understanding is it should return cropped image but with the size relative to the image size not the viewport size

@liran-co
Copy link

liran-co commented Nov 2, 2017

I'm having the same issue

@diachedelic
Copy link

diachedelic commented Nov 29, 2017

I have this issue when calling croppie.result() before the user does any zooming. Calling croppie.setZoom() is not a workaround. Furthermore, the image gets stretched in the x-direction. And it seems to be intermittent.

@diachedelic
Copy link

I think I have found the issue, its a result of prematurely calling self.elements.preview.getBoundingClientRect(), which returns incorrect values.

    function _updatePropertiesFromImage() {
        var self = this,
            ...
            img = self.elements.preview,
            imgData = self.elements.preview.getBoundingClientRect(),
            ...

        ...

        self._originalImageWidth = imgData.width;
        self._originalImageHeight = imgData.height;
       ...
   }
...

imgData.width === 344 but img.width === 480 (as it should be). Is there any reason img.width is not used directly here?

@diachedelic
Copy link

diachedelic commented Nov 29, 2017

Oh this appears to be fixed by #398 which isn't released yet - how frustrating! Can we have a 2.5.2 please?

@thedustinsmith
Copy link
Contributor

Yeah - I plan on releasing 2.5.2 soon, sorry.

@thedustinsmith
Copy link
Contributor

Going to go ahead and close this one since it's fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants