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 01-22-2016, 12:37 PM   #16
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)
@KevinH,

I don't want to make them required as long as they are only used by plugins.

Users of Arch Linux and derivatives are expected to read installation messages re: optional dependencies. I made it as clear as I can -- if you use plugins, you should really consider installing the optdepends.

Arch is about informed user choice, after all.

...

Any python modules utilized by the python code shipped with Sigil will be a hard dependency, though. I will keep an eye out for that (my job as an AUR maintainer).
eschwartz is offline   Reply With Quote
Old 01-27-2016, 07:46 AM   #17
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,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Thanks for this one, it is an improvement. Two small requests though... You currently add something to the title tag, could you consider leaving it empty? I know it is not used by readers and that is also the reason I rather have it empty.

The other question is about the filename. The 'old' plugin SVGWrapper created an XHTML page with the same name as the image without the extension. I actually like that a lot. Could you consider this as an option or having a naming option in the main screen?
Toxaris is offline   Reply With Quote
Advert
Old 01-27-2016, 07:53 AM   #18
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
Hi,

uhh title tag? Do you have an example? I'm using the cover template in sigil preference directory... But maybe i can delete it from there if present. Or do you meant the SVFWrap title in the default ttepmplate... Well i can use an empty title tag...

Regarding the filename: the old schema would fail due to images named

img.jpg
img.png

thats why i changed this to have a unique filename.
rubeus is offline   Reply With Quote
Old 01-27-2016, 09:08 AM   #19
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,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by rubeus View Post
Or do you meant the SVFWrap title in the default ttepmplate... Well i can use an empty title tag...
Yup, that is what I meant.

Quote:
Originally Posted by rubeus View Post
Regarding the filename: the old schema would fail due to images named

img.jpg
img.png

thats why i changed this to have a unique filename.
That makes sense, although I would never recommend two identical names with only a difference in extension.
Toxaris is offline   Reply With Quote
Old 01-29-2016, 02:58 AM   #20
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

This plugin is so useful that I have a proposal. It's about allowing captions.

When one adds images to one EPUB, many of them have captions. and it has always been tricky to find the right balance and be confident that the caption will be included with the image in the displayed page.

The current situation is not a happy one: some trust the engine (height: auto, width:auto), some trust the CSS (max-width... or page-break-inside: avoid), some others make deep calculations (width:63.5%; ) other insert the image and its caption in a two cells frame, what is sure is that everybody is praying God.

If a svg solution could be found, there would be a good chance that the bundle (image + caption) would stay together. That would be a big step for humanity.

I tried to fiddle a little with the code. One should probably add something like that somewhere, maybe by tweaking the viewbox to add a kind of lower stripe.

Code:
<text text-anchor="middle" x="50%" y="40" style="fill:black; font-size:25px; font-family:serif;font-style:italic;">Caption</text>
Could some expert try to find a solution of this kind? Once we have the code, it should not be too complicated to go from one standard svg image to another with caption.

Last edited by roger64; 01-29-2016 at 08:05 AM. Reason: stripe
roger64 is offline   Reply With Quote
Advert
Old 01-29-2016, 10:45 AM   #21
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,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by roger64 View Post
Code:
<text text-anchor="middle" x="50%" y="40" style="fill:black; font-size:25px; font-family:serif;font-style:italic;">Caption</text>
AFAK as I know text-anchor="middle" in the SVG will not work on ADE based readers. It is an old bug and never fixed.
Toxaris is offline   Reply With Quote
Old 01-29-2016, 10:55 AM   #22
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
Can somene please move this to the epub fprum? Once it has been discussed there i can see how i can implement a solution
rubeus is offline   Reply With Quote
Old 01-29-2016, 12:04 PM   #23
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 with minor improvements:

  • title tag is now empty
  • version correct
  • template for generated filenames available
  • if the number of added files is larger than 3 only a summary is shown and the faulty filenames can be seen in the launcher window

If you are not satisfied with the xhtml filenames you can now change this. But currently there is no GUI element available.

Start the plugin once. After finishing you will have a preference file in sigils plugins_prefs directory:

Code:
{
  "filename_template": "SVG_%f_%e",
  "lastDir": "..."
}
Change the template to whatever you want, %f is replaced with the filename of the image, %e is replaced with the extension of the image. The default guarantees that the filenames are unique.

Code:
{
  "filename_template": "%f",
  "lastDir": "..."
}
will bring back the old naming, but resulting filenames may conflict now.

Last edited by rubeus; 01-29-2016 at 12:07 PM.
rubeus is offline   Reply With Quote
Old 01-29-2016, 07:39 PM   #24
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)
Quote:
Originally Posted by rubeus View Post
Can somene please move this to the epub fprum? Once it has been discussed there i can see how i can implement a solution
You are right, I should have done it first. I take care of that and I open a new thread. Thanks.
roger64 is offline   Reply With Quote
Old 01-30-2016, 10:34 PM   #25
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)
A proposal with captions

Testing

I asked for advice on this thread. I got nearly instantly quite concrete answers. Please find enclosed two EPUBs, each with two images of a very different file size with a caption which make use of this rich information. They are just examples and a base for discussion. All the mistakes here are mine.

As you will see there are two slightly different techniques. While the code is basically the same, the first one makes use of a view box about the size of the image. The second one makes use of a standard 600x800 view box. For both, the images are untouched and the display looks good and reliable.

Personally, I would go for the second solution (bacelar) because it looks more easy to implement for a batch treatment. You can easily define some fixed bundles according to the number of lines needed for the caption and/or the font-size. I gave an example with a one line and four lines caption for two images of a very different size.

For the first solution however, things seem to be more complicated: the needed font-size varies according to the image definition, so you need to check it for each new image. For this reason too, you can obtain a uniform font-size for the captions through the book only if the images have strictly the same size.

On the technical side, I can't say if there is a drawback to any of them. They both take care of azw3 conversion while being Epubcheck compliant. However, as Toxaris remarked, it is possible that some readers with old machines experience font-display problems (no centering?). An EPUB3 version will soon be needed (with a new Doctype and a properties="svg" attribute) but it does not seem it will require a lot of changes.

Proposal

While it's not possible to match the flexibility of CSS, a reasonable choice could be to offer five different bundles. One could imagine (dream?) a new menu with a matrix where the user would select a number for each image. He should also have the possibility to select a column (all images) as a whole as images in the same book tend to use the same kind of caption.

- 1 without any txt (like now). Maybe this could be selected by default.
- 2 and 3 with short caption (up to two text lines) with average (24?) and smaller (20?) font-sizes.
- 4 and 5 with a longer caption (up to five text lines) with average and smaller font sizes.

One could simplify this to three bundles:
- 1 like today
- 2 short caption - average font-size
- 3 longer caption - smaller font-size

- If one needs over five lines of text, he would have to split fastidiously the intended caption paragraph. Maybe this would not be the most practical method.
- If one wishes a different font-weight or font-style, he can use a plain regex to change them.
- If one wishes to add its own style-sheet link in the head, idem.

An alternative idea would be to let the user select a font-size and number of text-lines but it would require probably more processing.
Attached Files
File Type: epub ruben_svg.epub (1,006.8 KB, 361 views)
File Type: epub bacelar_svg.epub (1,006.8 KB, 394 views)

Last edited by roger64; 01-30-2016 at 10:42 PM.
roger64 is offline   Reply With Quote
Old 02-07-2016, 04:48 AM   #26
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
Small improvement in #1 to version 032

If there are files selected in the book browser, the first book file is taken as default in the combobox to choose the position where the new file should be inserted.
rubeus is offline   Reply With Quote
Old 02-07-2016, 07:01 AM   #27
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,528
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by roger64 View Post

...

For the first solution however, things seem to be more complicated: the needed font-size varies according to the image definition, so you need to check it for each new image. For this reason too, you can obtain a uniform font-size for the captions through the book only if the images have strictly the same size.
...
Hi Roger;

Both methods (bacelar and mine), are practically the same. You say "the needed font-size varies according to the image definition" and, indeed, that is so because otherwise, caption would be ugly. With a image of 200x300 you can't use the same font size as an image of 2000x3000. Do the try and you'll see why. A practicall rule would be to use a font size (in pixels) about 5% of the width of the image.

Regards
Rubén
RbnJrg is offline   Reply With Quote
Old 02-08-2016, 05:03 AM   #28
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 Rubén

Thanks for posting this info on this thread and informing us. The following rule: "5% size transformed in pixels" seems indeed to be easily computed.

I had added this comment because we may encounter a book with a lot images + captions, and as worst cases happen, made of images with different file sizes but with only one expected font-size for captions.
roger64 is offline   Reply With Quote
Old 02-08-2016, 05:30 AM   #29
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
It will take some time until this will present, as i want to keep the plugin simple to use and don't want to bother users with captions, dialogs and questions and error messages who are not interested in captions. As i'm not so firm woth python i need to evaulate on how to create additional dialogs etc.
rubeus is offline   Reply With Quote
Old 03-16-2016, 02:59 PM   #30
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,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
When I add a picture with the file button, it will always be placed at the end. Even if I specify beforehand that I want it at another location, it is still placed at the end. Is this by design?
Toxaris is offline   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
[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 02:11 PM.


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