![]() |
#1 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
[Plugin] AdjustSVG
Hi,
YASP (yet another Sigil Plugin) When modifying images already wrapped into the SVG element like cropping or resizing you need to change the viewbox attribute values in the svg tag as well as the width and height attribute in the image tag... things a computer can do better. The plugin will scan all html files and look for an svg element having an image element as child, checking the dimensions and corrects them if they do not match. It requires sigil >= 0.9.1, Python >= 3.4, PIL and sigil_bs4 library. If you have enabled the internal python interpreter all this is present. If you are running an external Python interpreter i don't know if this is working due to the required sigil_bs4 lib (Beautifulsoup derivate) //rubeus Last edited by rubeus; 03-30-2016 at 04:25 AM. |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
|
Added to Sigil Plugin Index Sticky Thread
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
New version 0.1.1 in #1
- some minor improvements, better testing if its really an svg wrapper - broken image link will be detected without abend - workaround for camelcase attribute names in the svg tag |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Mar 2016
Device: Kindle Paperwhite 3
|
Very useful plugin... Thanks!
But... Is there a way to make the plugin change ONLY the attribute values inside the svg tag (e.g. don't change the indentation of the rest of the code of the file and the order of the elements and attributes inside the svg tag)? It's a minor detail that doesn't impact the text itself, but is a little annoying for people like me with a little bit of OCD regarding the way the code looks onscreen. |
![]() |
![]() |
![]() |
#5 |
Banned
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
It changes only the values inside the svg and img element already. Rest is done by beautifulsoup and plugin handler - nothing i can influence.
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] KindleUnpack - The Plugin | DiapDealer | Plugins | 523 | 07-15-2025 06:45 PM |
[FileType Plugin] YVES Bible Plugin | ClashTheBunny | Plugins | 27 | 01-16-2023 01:25 AM |
Plugin not customizable: Plugin: HTML Output does not need customization | flyingfoxlee | Conversion | 2 | 02-24-2012 02:24 AM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 12:11 PM |