Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-05-2017, 02:56 PM   #1
CalibUser
Zealot
CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.
 
Posts: 138
Karma: 61844
Join Date: Jul 2015
Device: Sony
Plugin to insert and wrap an image with SVG

Description
The attached plugin will enable you to select an image that already exists in your ePub book or import an external image and then insert it in a new xhtml section wrapping it using SVG.

How to use the plugin
Please see the attached user guide.

EDIT
I have updated the plugin to version 0.1.6.0.
This version lists images in alphanumerical order.


The attached ePub guide has been updated.

Please note that there is a bug in Sigil 0.99 - the first time you run the plugin it will try to run again when an image has been imported. To get round this issue please close Sigil after installing the plugin. You can then use the plugin next time you open Sigil.
Attached Files
File Type: zip InsertImageSVG_v0.1.6.0.zip (12.6 KB, 134 views)
File Type: epub User Guide for InsertImageSVG_v0.1.6.0.epub (732.9 KB, 87 views)

Last edited by CalibUser; 07-08-2018 at 09:08 AM. Reason: Updated plugin to version 0.1.6.0
CalibUser is offline   Reply With Quote
Old 02-05-2017, 03:49 PM   #2
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: 19,008
Karma: 97915638
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Thanks! I'll get it added to the plugin index.
DiapDealer is online now   Reply With Quote
Advert
Old 02-05-2017, 05:16 PM   #3
bravosx
Connoisseur
bravosx began at the beginning.
 
Posts: 54
Karma: 10
Join Date: Jun 2014
Location: Poland, Żory
Device: Prestigio PER3464B, Onyx Lynx, Lenovo S5000 i Tab4-8"
@CalibUser...

When you attempt to use the plug getting the message.



bravosx
Attached Thumbnails
Click image for larger version

Name:	zrzut.png
Views:	264
Size:	24.8 KB
ID:	154778  
bravosx is offline   Reply With Quote
Old 02-05-2017, 05:27 PM   #4
Doitsu
Wizard
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: 4,278
Karma: 14242649
Join Date: Dec 2010
Device: Kindle PW2
@bravosx: The plugin works fine on my Windows 10 machine. Did you check the Use Bundled Python box in the Manage Plugins dialog box?

If so, you'll need to post the steps that caused this message to be displayed, unless it's being displayed immediately after running the plugin.
Doitsu is offline   Reply With Quote
Old 02-05-2017, 05:37 PM   #5
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: 19,008
Karma: 97915638
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
The epub he opened probably has no images in it. I get the same error when launching the plugin when no images exist (in the plugin). Works fine on Linux, otherwise.

Just needs a way to handle the empty list situation, is all.


EDIT: I take that back. It's not the images. The error happens when an epub only has 1 xhtml file. One of the combo boxes is set to default to the second entry in the list ... but a brand-new epub only has one xhtml file.

Last edited by DiapDealer; 02-05-2017 at 05:51 PM.
DiapDealer is online now   Reply With Quote
Advert
Old 02-05-2017, 05:56 PM   #6
bravosx
Connoisseur
bravosx began at the beginning.
 
Posts: 54
Karma: 10
Join Date: Jun 2014
Location: Poland, Żory
Device: Prestigio PER3464B, Onyx Lynx, Lenovo S5000 i Tab4-8"
@Doitsu...
@DiapDealer...

Field: of Use Bundled Python box in the Manage Plugins dialog box is checked.

An error message is given a moment after starting the plug.

Images are included eo Images directory.

edit: The plugin works properly when epub is a lot of files in the folder text.

Sorry for my English.
Regards
bravosx

Last edited by bravosx; 02-05-2017 at 06:09 PM.
bravosx is offline   Reply With Quote
Old 02-06-2017, 02:17 AM   #7
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,480
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Thanks! I will wait for an update for the reported bug though!
Toxaris is offline   Reply With Quote
Old 02-06-2017, 08:28 AM   #8
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: 19,008
Karma: 97915638
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Some suggestions in the attached patch.

In addition to the index error, I'd suggest populating the combo box with the xhtml file _names_, rather than their manifest ids. Many people won't recognize those offhand.

Also the image file filter is broken on the openfile dialog. My png files wouldn't show up unless I changed to "All files".

Yours to do with what you will, of course. Thanks for the plugin!
Attached Files
File Type: txt insertsvg.patch.txt (1.6 KB, 105 views)

Last edited by DiapDealer; 02-06-2017 at 10:33 AM.
DiapDealer is online now   Reply With Quote
Old 02-06-2017, 02:38 PM   #9
CalibUser
Zealot
CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.
 
Posts: 138
Karma: 61844
Join Date: Jul 2015
Device: Sony
Thanks for the bug report and for the suggested patch - I have uploaded a correction in the first post of this thread

Last edited by CalibUser; 02-06-2017 at 03:21 PM.
CalibUser is offline   Reply With Quote
Old 02-11-2017, 03:53 PM   #10
CalibUser
Zealot
CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.
 
Posts: 138
Karma: 61844
Join Date: Jul 2015
Device: Sony
I have updated the plugin in the first post of this thread.

Quote:
Originally Posted by DiapDealer View Post
...I'd suggest populating the combo box with the xhtml file _names_, rather than their manifest ids. Many people won't recognize those offhand.
I am not sure what you were referring to - the combo box showed the names of the xhtml files when I ran the original plugin eg Section0001.xhtml. Was you referring to the Images\... reference in the listbox? The new version no longer shows Images\...
CalibUser is offline   Reply With Quote
Old 02-11-2017, 04:06 PM   #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: 19,008
Karma: 97915638
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by CalibUser View Post
I have updated the plugin in the first post of this thread.



I am not sure what you were referring to - the combo box showed the names of the xhtml files when I ran the original plugin eg Section0001.xhtml. Was you referring to the Images\... reference in the listbox? The new version no longer shows Images\...
No. The first version I saw was populating the combo box with the manifest ids of the epub's text files. Many epubs made by Sigil will have ids that match the filename (Sigil creates new files with ids equal to the filename if it can, but this isn't always guaranteed), but others may not. When I opened some of my own epubs, the combobox was populated with entries like "nav, toc" etc. They didn't match what I was seeing in Sigil's Book Browser.

You're not doing anything wrong, it's just that the manifest ids of an epub's files won't always match what a user sees in Sigil's Book Browser.

I included a "fix" for it in my patch. Perhaps you already applied it?

EDIT: Yes, I see my patched code being used on line 139
Code:
for id, href in self.bk1.text_iter():
    self.xhtmlTuple=self.xhtmlTuple + (os.path.basename(href),)
Originally it was:
Code:
for id, href in self.bk1.text_iter():
    self.xhtmlTuple=self.xhtmlTuple + (id,)

Last edited by DiapDealer; 02-11-2017 at 04:15 PM.
DiapDealer is online now   Reply With Quote
Old 02-11-2017, 04:10 PM   #12
KevinH
Wizard
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: 3,073
Karma: 1931746
Join Date: Nov 2009
Device: many
The content.opf uses manifest ids. A manifest id is any unique identifier name. To make dure the id is unique, some people and somesofrware will copy the file name and use it as the manifest identifier. This is a simple way to assure uniqeness but can be confusing as both the actual filename based on the manifest href and the manifest id can look identical but need not be. That is why using the filenam part of the href is recommended as the id for that same manifest entry could be something like "c1" instead of "chapter1.xhtml".

Hope this explains things.

KevinH
KevinH is offline   Reply With Quote
Old 02-11-2017, 04:20 PM   #13
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: 19,008
Karma: 97915638
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Also, a heads-up to all that Python 3.6 absolutely detests tuples with null elements. For future compatibility, consider not using code like:

EDIT: never mind ... I remembered the issue wrong. The issue was empty/Null first elements in tuple that can cause problems in 3.6+. But only in freaky os.execvp() commands that you probably won't run into. Sorry for any confusion.

Last edited by DiapDealer; 02-11-2017 at 04:33 PM.
DiapDealer is online now   Reply With Quote
Old 02-11-2017, 04:21 PM   #14
CalibUser
Zealot
CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.CalibUser has a propeller beanie that spins backward.
 
Posts: 138
Karma: 61844
Join Date: Jul 2015
Device: Sony
@DiapDealer - Thanks for the supplying the bug fix - I had not realised that my original code populated the combobox with entries like "nav, toc" etc as my tests did not show this - all my IDs did match the filenames in my tests so I didnot detect this problem.

@KevinH - Thanks for the clarification.
CalibUser is offline   Reply With Quote
Old 02-11-2017, 04:35 PM   #15
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: 19,008
Karma: 97915638
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
No problem!
DiapDealer is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrap in SVG plugin? gezginrocker Plugins 18 07-05-2015 12:20 AM
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
Image wrap test Jellby ePub 15 05-04-2011 02:30 PM
Combining blockquote with image wrap WRB Sigil 1 02-12-2011 07:46 PM


All times are GMT -4. The time now is 06:58 AM.


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