![]() |
[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. |
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. |
Using PIL offers the possibility to create an enhanced user interface showing thumbnails. Maybe in 5 years or so :rofl:
|
3 seconds after publishing the 010 version i got suggestions for new improvements :rofl:
Ok, here we go
Version 020 added to #1 |
New Version in #1
|
Hi
Thank you for your work. I did try it but it failed for a missing module. Code:
Statut :failedEdit: I realize have version 0.1; I will install 03 and report back. Sorry |
I installed the brand new 0.3 (which is still reported as 0.2) but the error message is the same.
|
Did you install PIL? Are you using the internal Python Interpreter?
|
Quote:
Code:
sudo pip install PillowCode:
sudo pip3 install Pillow |
This Version does not run with Python 2.7...
|
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. |
1 Attachment(s)
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). :thumbsup: |
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... |
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 |
@KevinH, eschwartz
Thanks for the advice. I will install these optional packages. :) |
| All times are GMT -4. The time now is 08:03 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.