I would like to rotate an <img>
element (JPG) 90 deg clockwise. The images might be rectangular and the solution must transform and rotate those pixel by pixel in Javascript (no CSS, no canvas transf, no jquery.rotate, etc) rotated image has to be saved to the server.
Asked
Active
Viewed 114 times
0

Miki
- 1,625
- 21
- 29
-
Not really sure exactly what you mean but you sure are picky with your requirements?! What have you tried and why the restrictions? – Rob Schmuecker Jul 15 '14 at 15:12
-
2`no CSS, no canvas transf, no jquery.rotate, etc` - won't work I guess. – m90 Jul 15 '14 at 15:12
-
2Use the power of your brain and imagine it rotated 90 degrees. Otherwise use CSS. – Oleg Jul 15 '14 at 15:14
-
I need to save the transformed/rotated img to the server. I've tried multiple JS libraries like pixastic, jquery.rotate, etc., but I cannot find a solution that let me save the transformed img to the server. – Miki Jul 15 '14 at 15:17
-
2OK - servers are ideal for this kinda stuff, however what about transforming it on a canvas and then base64 encoding it somehow? – Rob Schmuecker Jul 15 '14 at 15:22
-
Agreed with Rob. You'll want to do this in canvas. You can then dump your canvas out as a base64-encoded string and, if you need binary image data, you can use something like `atob` or `btoa` go get it back to binary data: http://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript. – ajm Jul 15 '14 at 15:27
-
Thanks guys, let me rephrase the question. – Miki Jul 15 '14 at 15:28