09-03-2018, 02:33 PM | #1 |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
SVG to rotate image
I have no real understanding of SVG, I use plugins to generate SVG wrappers for images and then place it.
One thing I often do with landscape mode images (e.g., maps) is to to rotate them 90% so they can be larger on the page -- I assume it's being read on a Kindle or other tablet so you can just turn it in your hand. It''s easy to rotate the image losslessly in Irfanview, but I wonder if I can import the image in normal orientation and use SVG to rotate it? Would make managing or revising the image easier. |
09-03-2018, 02:42 PM | #2 |
Grand Sorcerer
Posts: 6,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
I don't know about using SVG to do the rotation but the calibre Editor has a 'rotate image' tool. Clicking it rotates it 90-degrees at a time.
|
Advert | |
|
09-03-2018, 03:17 PM | #3 |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
|
09-03-2018, 10:45 PM | #4 |
A Hairy Wizard
Posts: 3,093
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
You could mess around with the TRANSFORM options, but I don't think there will be much, if any, support for that...especially with ePub2.
Check out this thread for a discussion on why its not even worth it with a reflowable epub and devices that autorotate - and zoom into the image with a tap. Last edited by Turtle91; 09-03-2018 at 10:53 PM. |
09-04-2018, 12:39 PM | #5 | |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
Which is why my question is about how to do it in SVG. But it seem not a lot of SVG coders here. Last edited by AlanHK; 09-04-2018 at 12:49 PM. |
|
Advert | |
|
09-04-2018, 03:39 PM | #6 |
Grand Sorcerer
Posts: 6,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
I seem to remember that MR member RbnJrg knows a lot about SVG and epub. If he doesn't see this thread it might be worth PM-ing him. He's usually very helpful about sharing info.
|
09-04-2018, 07:28 PM | #7 |
Zealot
Posts: 119
Karma: 64428
Join Date: Aug 2011
Device: none
|
I've fooled around with some SVG transforms before. The short answer to your question is Yes, you can rotate images using just SVG. You can also scale, skew, translate and possibly reflect the image to somewhere else in the viewport. The image could be a jpg, png, geometric primitive such as rect, text, most anything. Look up a reputable tutorial on SVG, especially transforms, and see what you can come up with. A couple things you must not forget: 1) The viewport defines a virtual "canvas" with left-hand coordinates (meaning simply that the origin is in the UPPER left corner, instead of the BOTTOM left corner), which often corresponds to pixels, but it doesn't have to. All transforms are performed on this canvas. Actual screen pixels aren't assigned until SVG finishes its job. 2) rotations are done about the (0,0) point of the canvas. You will probably want to translate the center of you image to (0,0), do the rotation, and then back-translate it to where it came from. |
09-05-2018, 06:05 PM | #8 | |
Wizard
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
http://tutorials.jenkov.com/svg/index.html and regarding "transformations", this page: http://tutorials.jenkov.com/svg/svg-transformation.html But the best way to proceed while one is not acustomed to work with SVG images, is to download Inkscape and play with it. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
svg image on top of a background png image | roger64 | ePub | 25 | 04-24-2015 11:00 AM |
Display of a png image linked to a svg image | roger64 | Editor | 6 | 03-13-2015 06:21 AM |
Aura HD CBZ/CBR how to rotate image comics? | Start | Kobo Reader | 4 | 08-22-2014 07:17 PM |
Rotate every other image from a folder | DSpider | Workshop | 5 | 05-31-2012 03:00 PM |
Image zoom / rotate with PocketBook 360 ? | spangen | PocketBook | 0 | 06-10-2010 06:34 AM |