12-21-2015, 03:39 AM | #1 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
[Plugin] AddImgasSVG
Hi,
Doitsu has published a plugin to select an image which is then inserted as a complete new page wrapped in SVG to fill the entire screen retaining the aspect ratio. This is the same way the Add Cover menu item is working, but without adding the semantics. The original Version can be found here: https://www.mobileread.com/forums/sho...d.php?t=255300 At first some honorable mentions:
The way of publishing the enhanced version was Doitsu's proposal. What has been enhanced?
What is the disadvantage? My Version is Python >3 only. This and the PIL library are present when using Sigil > 0.9.1 using the internal python interpreter. If you still want to use Python 2.7 you need to install Doitsu's version which can be found in the thread linked above. Last edited by rubeus; 03-30-2016 at 04:26 AM. |
12-21-2015, 06:14 AM | #2 |
Sigil Developer
Posts: 7,635
Karma: 5433388
Join Date: Nov 2009
Device: many
|
BTW, if all you need from PIL is image size info, you might want to check out the python code in KindleUnpack that handles generation of covers called mobi_cover.py.
It can be found here: https://github.com/kevinhendricks/Ki.../mobi_cover.py There is a bug fixed image type identifier and the original image size routine that PIL used to create their version that was written by Draco. If you use that version, you may not need PIL at all. |
Advert | |
|
12-21-2015, 06:52 AM | #3 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
Using PIL offers the possibility to create an enhanced user interface showing thumbnails. Maybe in 5 years or so
|
12-25-2015, 06:46 AM | #4 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
3 seconds after publishing the 010 version i got suggestions for new improvements
Ok, here we go
Version 020 added to #1 Last edited by rubeus; 12-26-2015 at 10:51 AM. |
01-04-2016, 01:57 AM | #5 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
New Version in #1
|
Advert | |
|
01-10-2016, 04:01 AM | #6 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
Thank you for your work. I did try it but it failed for a missing module. Code:
Statut :failed Traceback (most recent call last): File "/usr/share/sigil/plugin_launchers/python/launcher.py", line 134, in launch target_script = __import__(script_module) File "/home/roger/.local/share/sigil-ebook/sigil/plugins/AddImgasSVG/plugin.py", line 9, in <module> from PIL import Image ImportError: No module named 'PIL' Error: No module named 'PIL' Edit: I realize have version 0.1; I will install 03 and report back. Sorry Last edited by roger64; 01-10-2016 at 04:03 AM. Reason: edit |
01-10-2016, 04:10 AM | #7 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
I installed the brand new 0.3 (which is still reported as 0.2) but the error message is the same.
|
01-10-2016, 04:52 AM | #8 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
Did you install PIL? Are you using the internal Python Interpreter?
|
01-10-2016, 05:43 AM | #9 | |
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Code:
sudo pip install Pillow Code:
sudo pip3 install Pillow |
|
01-10-2016, 07:34 AM | #10 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
This Version does not run with Python 2.7...
|
01-10-2016, 08:25 AM | #11 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Keep in mind that the Linux version of Sigil does not have a bundled (internal) Python interpreter. Check out the BuildingOnLinux docs at github to see what additional Python modules you'll need to install to meet the minimum requirements for a basic Sigil plugin environment on Linux.
And in this case, since the developer indicates that his plugin does not support Python 2, you'll want to install the modules with pip3. Last edited by DiapDealer; 01-10-2016 at 08:30 AM. |
01-10-2016, 08:34 AM | #12 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thank you all. I knew nothing about Mr PIL.
It works perfectly well with 3.4 -64 bits- (and the idea to place it either on first page, last page, page before or after is excellent). I joined a copy of what I had to install on Arch.I did not need to install the huge optional package (see screenshot). Last edited by roger64; 01-10-2016 at 08:41 AM. |
01-22-2016, 12:42 AM | #13 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Do note that I, the sigil-git AUR maintainer, explicitly listed python-pillow as an optdepends.
With the message that it is one of several modules *recommended* if you are going to be using plugins. Please keep in mind when running plugins in Sigil on Arch Linux, that if you haven't installed the optdepends you may run into problems where plugins expect a module that you have *chosen* to skip installing. User centrism gives you the power to shoot yourself in the foot if you don't pay attention... |
01-22-2016, 10:18 AM | #14 |
Sigil Developer
Posts: 7,635
Karma: 5433388
Join Date: Nov 2009
Device: many
|
FWIW, I strongly recommend these python3 packages be required not optional. Sigil is going to start using its embedded python interpreter more to implement many of the epub3 related features. Especially when it tries to implement support for fixed format epubs. So even internal Sigil python code, not just plugins, will start to use those packages the way they use lxml right now. It will also reduce the number of bug reports on linux like this one.
Thanks, KevinH |
01-22-2016, 10:36 AM | #15 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@KevinH, eschwartz
Thanks for the advice. I will install these optional packages. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[FileType Plugin] YVES Bible Plugin | ClashTheBunny | Plugins | 27 | 01-16-2023 01:25 AM |
[GUI Plugin] KindleUnpack - The Plugin | DiapDealer | Plugins | 492 | 10-25-2022 08:13 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 |