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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-08-2017, 07:23 PM   #1081
botmtl
Enthusiast
botmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel is
 
botmtl's Avatar
 
Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
Quote:
Originally Posted by Rev. Bob View Post
Who on Earth is building ebooks that way, instead of using image files like a sane person? There are times when text-encoded images make sense on the web, but in a static ebook file? That's just plain inefficient.
For the example I created, I doesn't make much sense. However, there is lots of fancy stuff you can do efficiently with data-uris. The book I bought used data-uris to make fancy/themed <hr>s that didn't require much data at all.

Besides, I think there a a lot of users who do download web pages (that potentially have images encoded this way) and make them into ebooks (fanficfare, news recipes, read-it-later type websites, etc.). I am one of them.

Last edited by botmtl; 03-08-2017 at 07:28 PM.
botmtl is offline   Reply With Quote
Old 03-09-2017, 01:29 AM   #1082
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by botmtl View Post
For the example I created, I doesn't make much sense. However, there is lots of fancy stuff you can do efficiently with data-uris. The book I bought used data-uris to make fancy/themed <hr>s that didn't require much data at all.
It's still more efficient to actually store the image, unless we're talking about something so tiny that the overhead of creating a file at all is a significant factor. (In which case, I'll still point to the cover image as the biggest part of almost any ebook and stick to my guns.)

Is the book in question self-published or traditionally published?

Quote:
Originally Posted by botmtl
Besides, I think there a a lot of users who do download web pages (that potentially have images encoded this way) and make them into ebooks (fanficfare, news recipes, read-it-later type websites, etc.). I am one of them.
I think that's a much smaller population than you think it is. It may seem larger from the inside, but I doubt it's a drop in the bucket as a proportion of Ebook-Reading People.
Rev. Bob is offline   Reply With Quote
Advert
Old 03-09-2017, 01:51 AM   #1083
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,908
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by botmtl View Post
For the example I created, I doesn't make much sense. However, there is lots of fancy stuff you can do efficiently with data-uris. The book I bought used data-uris to make fancy/themed <hr>s that didn't require much data at all.
Unless they were all different, then using an image for the divider probably takes less space. Especially if there is only a few used a lot of times. But, I am curious to see it. Can you point it out?
Quote:
Besides, I think there a a lot of users who do download web pages (that potentially have images encoded this way) and make them into ebooks (fanficfare, news recipes, read-it-later type websites, etc.). I am one of them.
Really? I don't think I've seen a page that did this for a long time. And I've never downloaded one for later reading. As you mention FanFicFare, can you point to a site doing it?
davidfor is offline   Reply With Quote
Old 03-09-2017, 11:39 AM   #1084
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by botmtl View Post
I have noticed that "data-uris" are detected as broken links and removed by this plug-in.

Would it be possible to fix this behavior?
BTW, it's really helpful if you actually tell me what you're doing instead of being this vague. This plugin has a lot of features and switches and multiple modes of use; hows about at least a hint of how I can replicate the behavior?

I mean, after I got the EPUB to the point where it would validate, I ran my standard cleanup pass on the file and got no errors. That means that either the validation fixes resolved the issue (in which case, not a bug) or you're doing something I normally don't.

This doesn't mean I'll make the change you're after - only that if I elected to investigate, I'd need more information than you've provided. In addition, that also means the behavior's in code I had nothing to do with, which would make changes more problematic.
Rev. Bob is offline   Reply With Quote
Old 03-09-2017, 12:22 PM   #1085
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,645
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Rev. Bob View Post
BTW, it's really helpful if you actually tell me what you're doing instead of being this vague. This plugin has a lot of features and switches and multiple modes of use; hows about at least a hint of how I can replicate the behavior?

I mean, after I got the EPUB to the point where it would validate, I ran my standard cleanup pass on the file and got no errors. That means that either the validation fixes resolved the issue (in which case, not a bug) or you're doing something I normally don't.

This doesn't mean I'll make the change you're after - only that if I elected to investigate, I'd need more information than you've provided. In addition, that also means the behavior's in code I had nothing to do with, which would make changes more problematic.
A data URI is a way to display an image without having to have a graphic file.

https://css-tricks.com/data-uris/

That link will tell you about data URIs. Data URIs do work with ADE and Calibre.
JSWolf is offline   Reply With Quote
Advert
Old 03-09-2017, 01:13 PM   #1086
botmtl
Enthusiast
botmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel is
 
botmtl's Avatar
 
Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
Quote:
Originally Posted by Rev. Bob View Post
BTW, it's really helpful if you actually tell me what you're doing instead of being this vague.
Sorry! I totally forgot to to indicate the steps to reproduce the problem. I was using "remove broken image pages" on some epubs and noticed that images with data-uris are considered invalid. I then made a silly epub with the type of images that get destroyed with the "remove broken image pages" switch on.

This is what I get when I run modify-epub with that switch on:
Looking for html pages containing only broken image links
- Broken image link: "data:image/png;base64,iVBORw0KGg[...] in: ModifyEpubBug2.html
- Broken image link: "data:image/png;base64,iVBORw0KGgoAA in: ModifyEpubBug.html
botmtl is offline   Reply With Quote
Old 03-09-2017, 03:17 PM   #1087
Rev. Bob
Wizard
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
Quote:
Originally Posted by JSWolf View Post
A data URI is a way to display an image without having to have a graphic file.
No kidding!

I already KNEW that part; I remember base64 encoding from back when it supplanted UUEncoding on Usenet. Doesn't help one bit in diagnosing the plugin problem reported, though.

botmtl - I suspect from your description that "data:" isn't getting recognized as a protocol and is instead being treated as a filename... which, of course, doesn't exist and thus gets flagged as broken. It seems the official EPUB validation software has had some issues with that, in the context of pages saved in subdirectories.

Anyway, if that's the case, this may be a fairly simple fix - just treat a string beginning with those five characters as automagically okay. (True, that won't catch malformed/corrupted data streams, but I think that's an acceptable risk.) I'm not at the computer right now, though, so it'll have to wait. I'll also have to watch out for that subfolder issue, but it really depends on the guts of the image link validation routine and where the path gets added to the specified "filename."
Rev. Bob is offline   Reply With Quote
Old 03-09-2017, 08:03 PM   #1088
botmtl
Enthusiast
botmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel isbotmtl really knows where his or her towel is
 
botmtl's Avatar
 
Posts: 43
Karma: 70238
Join Date: Jun 2014
Device: none
I have a suggestion for a fix if you like it. In container.py (get_page_image_names), line 784, instead of
Code:
images = XPath('//h:img[@src]')(data)
use
Code:
images = XPath('//h:img[not(starts-with(@src,"data:"))]')(data)
?

**disclaimer: I'm about as good with python as I am programming LISP or assembly.
**disclaimer: I haven't actually tried it in the plugin, but I known the XPath is valid at the very least.

Last edited by botmtl; 03-09-2017 at 08:06 PM.
botmtl is offline   Reply With Quote
Old 04-11-2017, 03:09 AM   #1089
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,457
Karma: 26645808
Join Date: Mar 2012
Location: Sydney Australia
Device: none
If anyone is looking for the discussion on greyscale cover images, it's here Send/Save Cover in Greyscale

BR
BetterRed is offline   Reply With Quote
Old 07-22-2017, 02:32 PM   #1090
senhal
Connoisseur
senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.senhal knows what's going on.
 
senhal's Avatar
 
Posts: 80
Karma: 25684
Join Date: Sep 2014
Device: Kindle NT
Quote:
Originally Posted by kiwidude View Post
Remove non dc: metadata from manifest
Is it possible to remove them also from html files?
Thanks!
senhal is offline   Reply With Quote
Old 07-22-2017, 03:10 PM   #1091
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,645
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by senhal View Post
Is it possible to remove them also from html files?
Thanks!
Try it and see. There is an option to do this. But I don't know if it is for OPF only. I've never used that option.
JSWolf is offline   Reply With Quote
Old 07-23-2017, 02:58 AM   #1092
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,517
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Rev. Bob View Post
Quote:
Originally Posted by botmtl View Post
Besides, I think there a a lot of users who do download web pages (that potentially have images encoded this way) and make them into ebooks (fanficfare, news recipes, read-it-later type websites, etc.). I am one of them.
It's still more efficient to actually store the image, unless we're talking about something so tiny that the overhead of creating a file at all is a significant factor. (In which case, I'll still point to the cover image as the biggest part of almost any ebook and stick to my guns.)

Is the book in question self-published or traditionally published?

I think that's a much smaller population than you think it is. It may seem larger from the inside, but I doubt it's a drop in the bucket as a proportion of Ebook-Reading People.
I do download quite a few bits off the web to convert into epubs and I have seen a page that used data URIs for images exactly once a couple of years back when I was downloading a web short story to convert to an epub. Generating an image file from the data and referencing that file reduced the final epub size by a negligible amount -- the recurring data strings compressed quite happily -- but it made it a lot easier for me to read the code without an multi-line block of gibberish every time a horizontal rule was applied which was about every second paragraph. The author was also excessively fond of em dashes and ellipses.

Last edited by DNSB; 09-07-2017 at 09:53 PM.
DNSB is offline   Reply With Quote
Old 09-07-2017, 10:33 AM   #1093
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 667
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by DNSB View Post
an multi-line block of gibberish every time a horizontal rule was applied which was about every second paragraph.
Presumably the same image? If so, could have put it in CSS and had it once in the CSS file. I just found a retail book that did that; I think it was the publisher's logo. I can see the logic in that if you're making a series of books. Just copy one single CSS file and the images it needs can't be misplaced (unless some plugin erases them).
AlanHK is offline   Reply With Quote
Old 09-07-2017, 09:57 PM   #1094
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,517
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by AlanHK View Post
Presumably the same image? If so, could have put it in CSS and had it once in the CSS file. I just found a retail book that did that; I think it was the publisher's logo. I can see the logic in that if you're making a series of books. Just copy one single CSS file and the images it needs can't be misplaced (unless some plugin erases them).
There were 4 horizontal rule blobs with negligible changes in the width of the rule plus minor changes in the overall size of the image. I replaced the 4 with a single image and haven't really noticed any difference in my reading enjoyment.
DNSB is offline   Reply With Quote
Old 09-28-2017, 03:35 PM   #1095
Barb-B
Tech appreciator
Barb-B began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2012
Device: Onyx Boox Kepler Pro (wow I love this reader!)
Forego backup option

Praise and gratitude for this fabulous tool.

It would be very nice to have an option to simply overwrite the existing epub file, rather than create a backup with the ".ORIGINAL_EPUB" extension. Since I'm running the routine immediately after importing the book to Calibre, I already have a backup in the original imported file. If the results should go disastrously wrong (though they never do), I can always re-import the original. Would save the extra step of having to delete the backup copies every single time.

Even though I already made a $ contribution some time ago, I would seriously consider doing it again if my wish were granted.

Thanks!
Barb-B is offline   Reply With Quote
Reply

Tags
modify epub

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1171 03-23-2024 05:18 AM
[GUI Plugin] Open With kiwidude Plugins 402 03-16-2024 11:44 PM
[GUI Plugin] Manage Series kiwidude Plugins 166 02-13-2024 11:31 AM
Modify ePub plugin dev thread kiwidude Development 346 09-02-2013 05:14 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 09:45 AM.


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