matiasgali / guillotine

jQuery plugin to crop images within an area (fully responsive), allowing to drag (touch support), zoom and rotate.
http://guillotine.js.org
326 stars 100 forks source link

IE8 - Scale value seems to be incorrect. #23

Closed christian-thomas closed 9 years ago

christian-thomas commented 9 years ago

Just testing my application through IE8 (Guillotine v1.3.0), and it appears that 'scale' is being reported incorrectly.

I've got the following JS, using exactly the same image:

$image.guillotine({
    width:      480,
    height:     480,
    onChange:   function(event){

        $form
            .find('[name="image_data"]')
            .val(JSON.stringify(event));
    }
});

$image.guillotine('fit');

Then when I post the form data to my server, I get the following outputs:

IE8
[2015-01-14 12:51:03] staging.INFO: Image Data {"image_data":"[object] (stdClass: {\"scale\":2.962962962962963,\"angle\":0,\"x\":80,\"y\":0,\"w\":480,\"h\":480})"} []
Chrome
[2015-01-14 12:51:09] staging.INFO: Image Data {"image_data":"[object] (stdClass: {\"scale\":0.625,\"angle\":0,\"x\":80,\"y\":0,\"w\":480,\"h\":480})"} []

Image below if you need it for testing purposes.

toco toucan

matiasgali commented 9 years ago

If the image is zoomed the same amount in both cases and the scale is different then there's something off, but first we need to determine that in each test the initial zoom is the same and that the zoom applied to both is effectively the same.

Let me know how you applied zoom in both tests and post the complete code, including not only where you init the plugin but also where you bind events to actions or wherever you use the plugin's API.

christian-thomas commented 9 years ago

Yep, I should've mentioned.

There's been no zooming or any events applied to the images. They're just in the same state that they are when they're the page first loads on both browsers.

I also tried IE9, and that's fine I believe - Reports the same as Chrome.

matiasgali commented 9 years ago

I can't reproduce the issue, I tested on Chromium for Linux and on IE8 in a virtual WinXP, both behave the same. Scale is 0.625 in both cases.

ie8_chrome

I changed the code in the demo to match yours:

picture.guillotine({ width: 480, height: 480, eventOnChange: 'guillotinechange' })
picture.guillotine('fit')
christian-thomas commented 9 years ago

I'll see if I can duplicate your demo code and give you a bit more insight into this tomorrow.