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 05-06-2012, 04:38 AM   #91
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,845
Karma: 128597114
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 kiwidude View Post
The remove non dc: metadata option will remove all the calibre specific metadata cruft along with any from other tools like Sigil. As stated elsewhere in this thread it is almost mutually exclusive with the update metadata option, since the latter always runs last. But as you say it does no harm for most users, it is only those who are submitting their books for publication and get blocked by tools those sites have to reject epubs with cruft in them that will care.
Actually, don't remove the Sigil line in the OPF. It's nice to know what program what used to edit the ePub. The rest of the Calibre OPF additions can go.

Quote:
Not sure what you mean by the second comment. Do you mean why update the internal ePub opf file when calibres library has an opf file too? If so the answer is that if you open the book using calibres viewer, it only uses what is internal to the ePub. So the title, author in the window title and opening cover might not match what your library have displayed in calibre. So people who actually read their books on the computer using the calibre viewer, or who do direct things with the calibre file system (which we know they shouldn't but people still do) rather than using calibres export features have a way of getting the ePub internally correct without having to do an ePub -> conversion.
I mean, why have Calibre modify the ePub's OPF when there is a Calibre OPF that can be used for that. The stuff Calibre puts in is only valid for use with Calibre. So really, it belongs in the other OPF. Not the ePub's.
JSWolf is offline   Reply With Quote
Old 05-06-2012, 05:14 AM   #92
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by JSWolf View Post
Actually, don't remove the Sigil line in the OPF. It's nice to know what program what used to edit the ePub. The rest of the Calibre OPF additions can go.
there is no granularity with the remove option, just like there is no granularity with the websites that reject epubs with this data in it. If you want control like that then you would tweak ePub it.
Quote:
Originally Posted by JSWolf View Post
I mean, why have Calibre modify the ePub's OPF when there is a Calibre OPF that can be used for that. The stuff Calibre puts in is only valid for use with Calibre. So really, it belongs in the other OPF. Not the ePub's.
Right, for which I gave the answer above - any tools that you open the ePub with use the internal data, nothing uses calibres opf file except calibre when restoring a library or adding books. And not all of the data updated is calibre specific. For instance the title and author fields. Or the cover. Like I said the net effect is no different to exporting from calibre.

Now arguably someone might want an option to do an update metadata which only does non calibre specific stuff and does not insert all the junk like custom column data. However the calibre code offers no such granularity, which would mean I have to replicate it into this plugin and maintain it. Which I can't be bothered with, since few people on this earth are bothered by metadata cruft, and those that are can choose either not to use the Update metadata option, or can do a Remove non dc: metadata pass after it.
kiwidude is offline   Reply With Quote
Advert
Old 05-06-2012, 08:33 AM   #93
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,198
Karma: 16228558
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by JSWolf View Post
The stuff Calibre puts in is only valid for use with Calibre. So really, it belongs in the other OPF. Not the ePub's.
I don't believe this is true. I've used both Mantano and Coolreader apps on my Android phone. Both of them understand the Series and series_index fields, which I believe are Calibre-specific opf metadata fields.
jackie_w is offline   Reply With Quote
Old 05-06-2012, 10:12 AM   #94
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,762
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I see no problem with leaving properly formatted Sigil or Calibre Metadata.
An argument could be made that removing this after using the program to create or modify the book, is similar to removing the copyright/branding in the source code of the program. The program is just signing its work.
theducks is offline   Reply With Quote
Old 05-06-2012, 01:47 PM   #95
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,198
Karma: 16228558
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
There are definitely certain calibre metadata items I'd prefer not to have transferred to my epubs, namely some of my custom columns, but I don't know whether that could be done by a plugin or whether it would need to be in main calibre. Perhaps a checkbox for each custom column. Just an idea, but I don't know how many people would be bothered to use it.
jackie_w is offline   Reply With Quote
Advert
Old 05-07-2012, 04:33 AM   #96
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
v1.1.2 Released

Changes in this release:
  • Fix for remove unused images to better handle image paths with spaces

Last edited by kiwidude; 05-07-2012 at 06:01 AM. Reason: Fix version number
kiwidude is offline   Reply With Quote
Old 05-07-2012, 06:00 AM   #97
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
v1.1.3 Released

Changes in this release:
  • Fix for remove unused images to better handle image paths with other characters like commas
kiwidude is offline   Reply With Quote
Old 05-07-2012, 11:29 AM   #98
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
v1.1.4 Released

Changes in this release:
  • Fix for remove unused images to check encrypted and unencrypted names, skip DRM ebooks
  • When using the Remove xpgt files and links option, remove trailing whitespace after the removed <link>
  • When no epubs are modified, ensure the log detail is available to review
kiwidude is offline   Reply With Quote
Old 05-07-2012, 11:11 PM   #99
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Replacing a CSS file

Kiwidude,

With all the changes you have been making recently, it has prompted me to ask for something that has been in my mind for a while...

Something I frequently do with epubs I download from a couple of site is to replace the CSS file with my version of it. I can do this via "Tweak ePub" or Sigil, but as I simply want to replace the existing file with one I prepared earlier, it seems like something that Modify ePub could do.

The changes that would be needed are:

- Option to say to replace the CSS file
- Someway to specify the CSS file - a field plus a filepicker or a prompt when pressing OK.
- Storing the options and file name for the next time

The only other question would be what to do if there are multiple CSS files in the ePub. Does it replace based on name, first, all or none of them. Or prompt to pick which one to replace. Replacing the same named one is the safest, but if there is only one, replacing its contents is not unreasonable.

Any chance of this? Anyone else want it?
davidfor is offline   Reply With Quote
Old 05-08-2012, 09:50 PM   #100
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,762
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Kiwidude

removing xpgt files and links (using the PI) leaves the manifest entry which then fails 'missing manifest files'

Code:
Manifest file missing from ePub:  OEBPS/page-template.xpgt
theducks is offline   Reply With Quote
Old 05-09-2012, 03:40 AM   #101
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
... and wait for it...

That's what happens when you don't work on a plugin for a long time and resort to copy/pasting from the first other "delete" example you find in your code... which in this case would have been the "Remove *unmanifested* files" which simply ensures the file doesn't get zipped back up again...

Remove unused images will probably have the same issue. I'll push up a new version shortly. At least you have a function in the plugin to complete the job in a second pass in the meantime...

Edit: Remove unused images is fine, it appears only the xpgt files function was affected.

Last edited by kiwidude; 05-09-2012 at 04:45 AM.
kiwidude is offline   Reply With Quote
Old 05-09-2012, 05:14 AM   #102
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
v1.1.5 Released

Changes in this release:
  • Fix for Remove xpgt files and links to remove the xpgt file from the manifest
  • When performing any Modify action, update the last_modified column in calibre for the book.
Thanks to theducks for finding the oversight in the "Remove xpgt file" feature. If you have used that feature (it was only added a few days ago) then there is a simple fix for the books that would be affected as mentioned above. In Quality Check run the "Check manifest files missing" check and it will tell you which books have entries in the OPF manifest for which the physical files do not exist in the ePub. Then in this Modify ePub plugin for those books, use the "Remove missing file entries from manifest" option.
kiwidude is offline   Reply With Quote
Old 05-09-2012, 09:14 PM   #103
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,845
Karma: 128597114
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 davidfor View Post
Kiwidude,

With all the changes you have been making recently, it has prompted me to ask for something that has been in my mind for a while...

Something I frequently do with epubs I download from a couple of site is to replace the CSS file with my version of it. I can do this via "Tweak ePub" or Sigil, but as I simply want to replace the existing file with one I prepared earlier, it seems like something that Modify ePub could do.

The changes that would be needed are:

- Option to say to replace the CSS file
- Someway to specify the CSS file - a field plus a filepicker or a prompt when pressing OK.
- Storing the options and file name for the next time

The only other question would be what to do if there are multiple CSS files in the ePub. Does it replace based on name, first, all or none of them. Or prompt to pick which one to replace. Replacing the same named one is the safest, but if there is only one, replacing its contents is not unreasonable.

Any chance of this? Anyone else want it?
But what happens when your custom CSS is missing the classes needed or your same named classes are different enough?
JSWolf is offline   Reply With Quote
Old 05-09-2012, 10:39 PM   #104
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,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by JSWolf View Post
But what happens when your custom CSS is missing the classes needed or your same named classes are different enough?
Bad things. But...

In the cases I am doing this, the epubs are coming from a couple of different sites. Each site uses the same CSS for all their epubs. What I have done is take a copy of of the CSS file and made some minor changes. Now, each time I download a new epub from the sites, I replace the CSS file with mine.

Having an option in Modify ePub to do this is safe.
davidfor is offline   Reply With Quote
Old 05-10-2012, 04:21 AM   #105
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@davidfor - I'm afraid that functionality is just way too niche to consider for this plugin. There is such a small range of use cases where it would work. I would suggest the majority of users get their ebooks from a wide range of sources/publishers, which makes it impossible to do such a substitution without doing irreperable harm to the ebook.

I think you would be better off having a bespoke plugin that does specifically just this function. Or possibly even having it as a Sigil plugin (though this is not possible yet, but might be one day if it ever gets a plugin API).
kiwidude 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 1182 04-08-2024 10:04 AM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[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 03:21 PM.


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