Open GoogleCodeExporter opened 8 years ago
This is indeed a bug with jquery rotate and firefox, I suggest the dev changes
the
script to what I suggest below.
The problem is that, in firefox only, if the image hasn't been cached, it
doesn't
seem to rotate the images, AT ALL! No matter if you add a delay, or even do it
using
a function in the "onload" attribute of the image.
After many hours, I came up with a solution.
At the moment line 30 onwards looks like this:
canvas.oImage = new Image();
canvas.oImage.src = p.src;
etc.
Add two lines inbetween this two looking like this:
canvas.oImage.onload = function() {
}
Then move the code from:
canvas.style.width = canvas.width = Math.abs(costheta*canvas.oImage.width) +
Math.abs(sintheta*canvas.oImage.height);
to:
context.restore();
into this function. This ensures images are properly loaded. I imagine this is
a bug
with firefox / canvas. I was preloading the image before running the rotation,
but
the canvas seems to ignore that. I'd consider this a pretty major problem.
Anyone
visiting my site on firefox for the first time would not see any rotated images
and
because of the error a lot of other JS didn't work.
I've attached the updated jquery rotate too. Enjoy!
Original comment by youngest...@gmail.com
on 2 Jul 2009 at 3:16
Attachments:
Hi,
I tried your jquery.rotate.js and the first rotation is working fine. But when I
rotate the canvas image, the canvas is empty, and the image is gone away.
any ideas why?
Original comment by s.kimme...@metropolis-ag.de
on 30 Nov 2009 at 9:01
Hi,
Your solution made the trick for me. I have 12 images rotated on the load of
the page.
If only one image ratated you should check your javascript errors.
Thanks,
Original comment by cybermatthieu
on 30 Nov 2009 at 8:44
See issue 11 which solves the multiple rotation issue as well
Original comment by mike.mik...@gmail.com
on 15 Jan 2010 at 12:27
Original issue reported on code.google.com by
a.sterp...@gmail.com
on 8 Apr 2008 at 9:52