From: santel_helvis on
Hi All,

Could anyone tell me how to rotate the image in javascript. Which
concepts I should concentrate to rotate the image

From: bwucke@gmail.com on
http://www.kurs.horsesport.pl/inne/rv.html
Just to annoy PointedEars.

From: bwucke@gmail.com on

santel_helvis(a)sify.com napisal(a):
> Hi All,
>
> Could anyone tell me how to rotate the image in javascript. Which
> concepts I should concentrate to rotate the image

Okay, okay, I was cheating. That wasn't really rotation, just flipping.
Here you go, real rotation:
http://www.kurs.horsesport.pl/inne/rv2.html
Passed both Validator and Jigsaw, but tested only in FF1.5, don't have
anything else handy. You need to click "continue running script" when
prompted, then wait some...
Adding size detection and edge clipping left as an exercise to the
reader.

Seriously: I don't think there's any simple way to do what you want to
do. Most likely you need to get a base64-encoded image, decode it to an
array of integers/floats, process them according to the rules of given
image format to get a "bitmap" array, then pass them through the
rotation equations attached, reencode them back to GIF/JPG/whatever,
reencode them to base64, transform to a data: URI then hand the URI
over to an IMG tag. All in Javascript. Good luck writing JPEG
decompressor in Javascript. And of course it won't work in MSIE because
it has 256-char limit on all URIs.
In short: impossible.

From: Joaquin Cuenca Abela on
except if you use the new canvas and svg. This way it should work in
firefox (both), safari (canvas only) and Opera (svg only).

IE also has enough activex at its disposal to rotate an image.

Cheers,

From: Thomas 'PointedEars' Lahn on
bwucke(a)gmail.com wrote:

> santel_helvis(a)sify.com napisal(a):
>> Could anyone tell me how to rotate the image in javascript. Which
>> concepts I should concentrate to rotate the image
>
> Okay, okay, I was cheating. That wasn't really rotation, just flipping.
> Here you go, real rotation:
> http://www.kurs.horsesport.pl/inne/rv2.html
> Passed both Validator and Jigsaw, but tested only in FF1.5, [...]

It takes more than a minute to be displayed by my Firefox 1.5 and locks
it afterwards.

> You need to click "continue running script" when prompted, then wait
> some...

Obviously the author of that HTML document does not have any clue.


PointedEars
 |  Next  |  Last
Pages: 1 2 3
Prev: Getting IFRAME text
Next: getElementByName