youmoula / jcrop

Automatically exported from code.google.com/p/jcrop
0 stars 0 forks source link

When aspectRatio set it fails in IE7 and IE8 #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Setting aspectratio
2. Running on a picture in IE 7 and 8
3.

What is the expected output? What do you see instead?
I cant create a selection on the image to crop it.

What version of the product are you using? On what operating system?
ver. 0.9.8
XP and Windows7 / IE7 /IE8

Please provide any additional information below.
            $('#cropme').Jcrop({
                onSelect: showCoords,
                onChange: showCoords,
                boxWidth: 640,
                aspectRatio: 5 / 4,
                setSelect:   [ 0, 0, 1000, 1500 ],
                bgOpacity:   .3
            });

Removing apect ratio works fine.

Original issue reported on code.google.com by add...@gmail.com on 13 May 2009 at 2:49

GoogleCodeExporter commented 8 years ago
Sorry, the examples are working as they should in IE aswell even with aspect 
ratio... 
Som weird incompatibility with my code... It works perfect without aspectratio, 
but as 
soon as i add that parameter i get: Object doesn't support this property or 
method line 
253 char 5 in jcrop.js

Its never a problem with Firefox or Chrome only IE

Original comment by add...@gmail.com on 13 May 2009 at 5:01

GoogleCodeExporter commented 8 years ago
Maybe im just stupid but i post this incase someone else has problems.

I was using a callback to return coordinates (from examples) But the hidden 
input 
fields where not in a form and therefor IE was acting up...

Just added form tags around it and it works like a charm even in IE.

Original comment by add...@gmail.com on 13 May 2009 at 5:18

GoogleCodeExporter commented 8 years ago
I am having same issue. Please help. I debugged the code and the problem is in 
getFixed() on line 254 or line 273.

Original comment by nikola.y...@gmail.com on 22 May 2009 at 4:15

GoogleCodeExporter commented 8 years ago
Comment 2 by addebc is right.

I did the same, adding the form tags around the coordinates input fields and 
now it's
working good in IE6.

Original comment by ring...@gmail.com on 4 Aug 2009 at 3:19

GoogleCodeExporter commented 8 years ago
The fix by addebc worked for me too.

Original comment by s.j.wood...@gmail.com on 12 Aug 2009 at 7:20

GoogleCodeExporter commented 8 years ago
Thanks ringare!
It's working good in IE6 when you put form tags !

Original comment by pierregaste on 14 Aug 2009 at 9:02

GoogleCodeExporter commented 8 years ago
Hi All, I tried the form idea post with no luck and after deconstructing my 
page I 
found the another solution to this problem. Make sure you don't have any 
element on 
the page with IDs the same as a variable. In my case I had a span with an ID of 
"w" 
and "h" which seemed to conflict. I hope this helps someone.

Original comment by chris...@gmail.com on 3 Sep 2009 at 5:19

GoogleCodeExporter commented 8 years ago
Comment 2 works like a charm!

Original comment by rui.arc on 14 May 2010 at 1:27

GoogleCodeExporter commented 8 years ago
If you are still having issues with this, you can initialize the var w and h in 
the code and that will fix it in IE.

line 236:           var aspect = options.aspectRatio,
                min_x = options.minSize[0]/xscale, 
                min_y = options.minSize[1]/yscale,
                max_x = options.maxSize[0]/xscale, 
                max_y = options.maxSize[1]/yscale,
                rw = x2 - x1,
                rh = y2 - y1;
            var rwa = rw < 0 ? -rw : rw;
            var rha = rh < 0 ? -rh : rh;
            var real_ratio = rwa / rha,
                xx, yy, h, w
            ;

just add the h and w like above

Original comment by phillipt...@gmail.com on 3 Sep 2010 at 8:47

GoogleCodeExporter commented 8 years ago
Thanks to addebc.
Adding <form></form> around the cropper and elements worked perfectly.

Original comment by MercSt...@googlemail.com on 17 Sep 2010 at 8:56

GoogleCodeExporter commented 8 years ago
I had a similar issue where I was getting a "Object doesn't support this 
property or method" at line 329 when adding the aspectRatio in IE8. None of the 
previous comments were relevant and I had to change the line as below to get it 
to work. 

Existing line in v0.9.8 :

   return last = makeObj(flipCoords(x1,y1,xx,yy));

and I had to change this to just:

   return makeObj(flipCoords(x1,y1,xx,yy));

After this change my use of the code now works in both IE8 and Firefox.

Original comment by orroz1...@gmail.com on 17 Sep 2010 at 2:40

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Thank  philliptabb, it work well.

Original comment by phanngoc...@gmail.com on 19 Oct 2010 at 3:26

GoogleCodeExporter commented 8 years ago
@ comment #2  --- THANKS!  That ended an hour long freakout.  <form> tags 
everybody....

Original comment by i...@halfgeeks.com on 6 Mar 2011 at 6:20

GoogleCodeExporter commented 8 years ago
Thanks for the FORM TAG solution! this saved me another few hours \o/ \o/ \o/

Original comment by davidvan...@gmail.com on 7 Aug 2011 at 5:03

GoogleCodeExporter commented 8 years ago
Thanks for the form tage solution, addebc....!!
It has just saved my time.

Original comment by harshjay...@gmail.com on 19 Aug 2011 at 11:25

GoogleCodeExporter commented 8 years ago
I can also confirm that this bug occurs in IE 7 / 8 / 9 if you name/id any of 
the inputs on your page as `w` or `h` I didn't check `x` or `y` but I made sure 
that I changed those out as well.

Original comment by dbthorb...@gmail.com on 4 Apr 2012 at 9:45