Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-21-2015, 03:39 AM   #1
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
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:
  • Doitsu for his first version
  • KevinH for his patience
  • diapdealer and eschwarz for giving some nice tips'n'tricks

The way of publishing the enhanced version was Doitsu's proposal.

What has been enhanced?
  • the list in the dropdown menu is sorted
  • there are no other libs needed any more, imagesize determined with PIL
  • bug with non-unique filenames/ids fixed
  • existent cover.xhtml template used if present in sigil's preference environment

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.
rubeus is offline   Reply With Quote
Old 12-21-2015, 06:14 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is online now   Reply With Quote
Advert
Old 12-21-2015, 06:52 AM   #3
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
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
rubeus is offline   Reply With Quote
Old 12-25-2015, 06:46 AM   #4
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
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
  • Added the possibility to insert an image from disk which is wrapped in an SVG
  • prepared for autostart and autoclose launcher window
  • user interface improved

Version 020 added to #1

Last edited by rubeus; 12-26-2015 at 10:51 AM.
rubeus is offline   Reply With Quote
Old 01-04-2016, 01:57 AM   #5
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
New Version in #1
  • It's possible to select more than on image to be wrapped
  • The position where the wrapped images should be inserted can be chosen
  • Below the thumbnail there is some information about the active picture
rubeus is offline   Reply With Quote
Advert
Old 01-10-2016, 04:01 AM   #6
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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'
I use Sigil 9.2 (Archlinux 64 bits build)

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
roger64 is offline   Reply With Quote
Old 01-10-2016, 04:10 AM   #7
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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.
roger64 is offline   Reply With Quote
Old 01-10-2016, 04:52 AM   #8
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Did you install PIL? Are you using the internal Python Interpreter?
rubeus is offline   Reply With Quote
Old 01-10-2016, 05:43 AM   #9
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by roger64 View Post
I installed the brand new 0.3 (which is still reported as 0.2) but the error message is the same.
Depending on the Python interpreter(s) you've installed, you'll need to enter the following command(s) in a Terminal window:

Code:
sudo pip install Pillow
(Python 2.7)

Code:
sudo pip3 install Pillow
(Python 3.4)
Doitsu is offline   Reply With Quote
Old 01-10-2016, 07:34 AM   #10
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
This Version does not run with Python 2.7...
rubeus is offline   Reply With Quote
Old 01-10-2016, 08:25 AM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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.
DiapDealer is offline   Reply With Quote
Old 01-10-2016, 08:34 AM   #12
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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).

Attached Thumbnails
Click image for larger version

Name:	arch.png
Views:	562
Size:	109.6 KB
ID:	145405  

Last edited by roger64; 01-10-2016 at 08:41 AM.
roger64 is offline   Reply With Quote
Old 01-22-2016, 12:42 AM   #13
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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...
eschwartz is offline   Reply With Quote
Old 01-22-2016, 10:18 AM   #14
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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
KevinH is online now   Reply With Quote
Old 01-22-2016, 10:36 AM   #15
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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.
roger64 is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 12:56 PM.


MobileRead.com is a privately owned, operated and funded community.