Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-10-2011, 04:31 PM   #1
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
How to create tags by conversion?

Hi,

I'd like to know which format of a book was the source (added to calibre) and which format was created by calibre conversion from the source.

Is there an easy way to automatically create a custom tag like "Generated Mobi" or "Generated ePub" when the corresponding conversion takes place?

Or is there an even better way to track this information?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-10-2011, 08:41 PM   #2
speakingtohe
Wizard
speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.
 
Posts: 4,812
Karma: 26912940
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
This seems like a good idea.
I don't think there is anything built in but I could be wrong.
A custom column with the text limited to a list option would perhaps be best. (list being epub, mobi, lit, etc.
When adding books you could set the search to date:today and format:epub and bulk edit the metadata before converting.
speakingtohe is offline   Reply With Quote
Old 07-10-2011, 08:50 PM   #3
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: 30,909
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by speakingtohe View Post
This seems like a good idea.
I don't think there is anything built in but I could be wrong.
A custom column with the text limited to a list option would perhaps be best. (list being epub, mobi, lit, etc.
When adding books you could set the search to date:today and format:epub and bulk edit the metadata before converting.
I use the fcustom field with a fixed list.
I also made formats that include the real format hidden in a ZIP or RAR Zip(Txt), RAR(Doc),Zip(HTML)

Yes, You can add ZIp files that have TXT or any single valid format and Calibre can still convert.
theducks is offline   Reply With Quote
Old 07-11-2011, 04:00 AM   #4
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by speakingtohe View Post
This seems like a good idea.
Thanks

Quote:
I don't think there is anything built in but I could be wrong.
I'm willing to to patch calibre if there is no built in way to accomplish this, but I need a clue how to do that.


Quote:
When adding books you could set the search to date:today and format:epub and bulk edit the metadata before converting.
I definitely need an automatic process, everything manual will sometimes be forgotten and would make the information unreliable.

At least for the two formats I'm interested in (epub and mobi) calibre adds a creator setting in the file metadata during conversion, so it would also be a solution to see the value of this setting in the GUI, but I don't think that's possible either?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-11-2011, 04:07 AM   #5
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by theducks View Post
Yes, You can add ZIp files that have TXT or any single valid format and Calibre can still convert.
Hi,

do I understand that correctly, instead of adding an epub (or mobi) directly to calibre I would create a zip containing the source epub file and calibre would just extract that file when I do a zip to epub conversion?

Will the extracted file remain unmodified or is it modified like if I would add the epub directly and perform an epub to epub conversion (the latter would make it unusable for me as I don't want calibre to modify my files unless absolutely necessary and explicitly requested by me).

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-11-2011, 10:26 AM   #6
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: 30,909
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by siebert View Post
Hi,

do I understand that correctly, instead of adding an epub (or mobi) directly to calibre I would create a zip containing the source epub file and calibre would just extract that file when I do a zip to epub conversion?

Will the extracted file remain unmodified or is it modified like if I would add the epub directly and perform an epub to epub conversion (the latter would make it unusable for me as I don't want calibre to modify my files unless absolutely necessary and explicitly requested by me).

Ciao,
Steffen
I discovered this 'feature' accidentally

First: you do not need to put files into a Zip/RAR that can be added 'as is' .
Second: your reading device may not like your 'odd' format choice.

Third: Set cover from selected format does NOT function when inside a Zip/RAR

Conversion/Viewing seems to work, but I can't say that there are NO changes. Multiple formats within the archive definitely chokes conversion.

I only document the format contained to be clear on how I started.
theducks is offline   Reply With Quote
Old 07-11-2011, 02:33 PM   #7
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Hi theducks,

maybe I misunderstood something, but I just created a zip file containing a single epub file, dragged that zip onto calibre to add it, but calibre lists the available format as EPUB and if I open the books folder, it contains the epub, not the zip file.

The epub is identical to the original I put into the zip file though, so calibre seems just to extract it without any conversion, as if I would add the original epub file.

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-11-2011, 03:15 PM   #8
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: 30,909
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by siebert View Post
Hi theducks,

maybe I misunderstood something, but I just created a zip file containing a single epub file, dragged that zip onto calibre to add it, but calibre lists the available format as EPUB and if I open the books folder, it contains the epub, not the zip file.

The epub is identical to the original I put into the zip file though, so calibre seems just to extract it without any conversion, as if I would add the original epub file.

Ciao,
Steffen
I think you are correct. Calibre is smart enough to remove "excess packaging materials" (those that are not absolutely needed).
theducks is offline   Reply With Quote
Old 07-11-2011, 04:14 PM   #9
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by siebert View Post
I'd like to know which format of a book was the source (added to calibre) and which format was created by calibre conversion from the source.

I'm willing to to patch calibre if there is no built in way to accomplish this, but I need a clue how to do that.
One problem with automating this is that a "book" record doesn't separately store metadata about each of the "formats" of that book. Each format can have a different "source" or be its own original. There's no guarantee that any one format is the source for all others.

I may have the same book (different original formats) from two different sources, and third and fourth book formats converted from those two originals. You could add tags or add text to the comments, but keeping track of it all won't be easy. (What if I convert my third format, which came from format two into format one to replace that "original" format one?)
Starson17 is offline   Reply With Quote
Old 07-11-2011, 05:05 PM   #10
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by Starson17 View Post
One problem with automating this is that a "book" record doesn't separately store metadata about each of the "formats" of that book.
Yes. I've looked into the formats_sizes() template function to see if I could write a similar one for my needs, but the function doesn't have any metadata available which was parsed from the file, it only calls some os function to get the file size.

Quote:
Each format can have a different "source" or be its own original. There's no guarantee that any one format is the source for all others.
That's ok, I just want to separate the precious originals from the converted ones.

My current strategy is to add a tag "Converted <format>" (<format> is replaced by the format name like "Converted MOBI" or "Converted EPUB") when a new format is created by converting. I also look into the ebook metadata when a file is added and if the contributor tag contains "calibre", I also set the same tag. If I remove a format, the corresponding tag is unassigned if it was set.

With this scheme I can always identify the formats which were created by calibre (either because I triggered a conversion from another format or because the added file was created/converted by calibre). If there is a format without the matching tag I know it's the/a original format not modified by calibre.

What do you think of this solution?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 07-13-2011, 10:08 AM   #11
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by siebert View Post
I just want to separate the precious originals from the converted ones.....
What do you think of this solution?
That seems reasonable to me. If I understand your solution, the tag tells you that Calibre made the MOBI format, just not what original was used as the source. For books with only a single original format, you'd know the source. Do you write the "Converted EPUB" tag for an original EPUB format if you do an EPUB->EPUB conversion?

I decided I'd just keep my originals entirely outside of Calibre, so I've mostly avoided this issue. Some originals are great, but some are not. I wanted to feel free to modify/improve every format stored in Calibre, and if I messed an original up, I would just go back to my master originals, stored elsewhere. It was too easy to accidentally overwrite, merge, delete or do something bad to an original if kept inside Calibre.
Starson17 is offline   Reply With Quote
Old 07-13-2011, 11:08 AM   #12
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
I still think that it would be useful if I could click on a file in the MetaData Edit dialog, and have an option to "make into RAR" file.

I could then use this to easily create the master copy in the vast majority of cases. The problem at the moment is if using the normal Add Books route the contents of a RAR tend to automatically get extracted as part of the Add process. Since Calibre seems to be quite happy to process transparently process the contents of a RAR file when converting this would mainly be painless.

Of course some other file type could be used - I only suggested RAR as there is already support for that, and it would not collide with the current use of ZIP for HTml.
itimpi is offline   Reply With Quote
Old 07-13-2011, 01:48 PM   #13
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by itimpi View Post
I still think that it would be useful if I could click on a file in the MetaData Edit dialog, and have an option to "make into RAR" file.
Or even "Add to RAR file" that left the original format, and added the selected format to a RAR, even if the RAR already existed and had content. That way I could put several master source files into the RAR to protect them or just pop one in temporarily.

It's actually quite common for me to want to "protect" a format that I'm about to overwrite during a conversion. Right now I usually have to copy the book entry (with all of its formats), or do a Save to Disk on the format. before I run a conversion that will overwrite it.
Starson17 is offline   Reply With Quote
Old 07-13-2011, 01:53 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,195
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The proper fix for this issue is to define a special format called "MASTER" (which is just a zip file). Then whenever you do a format-format conversion, calibre will automatically put the original into the master. If you do a format to format again, calibre automatically uses the version from master (if it exists).

And of course there will be aright click menu to update the format in the master, in case you hand edit the file.

Unfortunately, this is rather a lot of work, and I am swamped working on the new database backend at the moment. So this is another item on my TODO list. Indeed, IIRC this was discussed a few months ago.
kovidgoyal is offline   Reply With Quote
Old 07-13-2011, 02:22 PM   #15
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Exclamation

Quote:
Originally Posted by Starson17 View Post
Right now I usually have to copy the book entry (with all of its formats), or do a Save to Disk on the format. before I run a conversion that will overwrite it.
"Save to Disk" won't help, as it modifies the metadata of the saved file (and currently breaks it: https://bugs.launchpad.net/calibre/+bug/809771), so the saved file is not identical to the original one!

Ciao,
Steffen
siebert is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
602 CREATE WALLPAPER terryhl PocketBook 5 03-29-2011 04:37 AM
Lit conversion w/<pre> tags DoctorOhh Conversion 8 02-10-2011 08:35 AM
Can't create a new collection VICROAMER Amazon Kindle 2 12-12-2010 02:41 AM
[Sony eReader] Create collection from Book Series, exclude tags Craysh Calibre 2 06-23-2010 09:21 AM
Looking for a way to create ebooks Tibor Workshop 7 01-26-2009 05:23 PM


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


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