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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-03-2010, 10:07 AM   #1
mumdigau
Member
mumdigau began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Aug 2010
Device: none
Can't change metadata with ebook-meta

Hi,

I'd like to change the metadata of a huge number of ebooks, so I would like to do that via a small batch file which repeatedly calls ebook-media with the appropiate data. But already my first manual try with ebook-media wasn't successful. I tried to change the author in an epub-file as follows:

ebook-media "path\filename" -a "firstname lastname"

But the metadata were left unchanged as could be seen from the output of ebook-meta in the terminal. I also tried '--authors' instead of '-a', but that didn't help either.

Calibre (latest version) is running on an Windows XP Pro SP3 system. The file is not write protected.

What am I doing wrong? Many thanks in advance for any help

ciao

mumdigau
mumdigau is offline   Reply With Quote
Old 08-03-2010, 10:12 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by mumdigau View Post
ebook-media "path\filename" -a "firstname lastname"
Your post title says ebook-meta and your post content says ebook-media?

Have you tried it without the quotes? If -a isn't working try the full --authors option instead.

I do all of my batch metadata updates via the gui, but the manual for ebook-meta is here.

Good Luck.

Last edited by DoctorOhh; 08-03-2010 at 10:16 AM.
DoctorOhh is offline   Reply With Quote
 
Enthusiast
Old 08-03-2010, 11:57 AM   #3
mumdigau
Member
mumdigau began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Aug 2010
Device: none
Quote:
Originally Posted by dwanthny View Post
Your post title says ebook-meta and your post content says ebook-media?

Have you tried it without the quotes? If -a isn't working try the full --authors option instead.
Sorry, it's a typo. It should have read ebook-meta, of course.

Yes, I tried without quotes even though the manual says to use quotes if the arguments contain spaces. I tried both, -a and --authors, nop. I even changed path\filename so that it doesn't contain any spaces: no success.

Any other ideas?

mumdigau
mumdigau is offline   Reply With Quote
Old 08-03-2010, 10:03 PM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by mumdigau View Post
Sorry, it's a typo. It should have read ebook-meta, of course.

Yes, I tried without quotes even though the manual says to use quotes if the arguments contain spaces. I tried both, -a and --authors, nop. I even changed path\filename so that it doesn't contain any spaces: no success.

Any other ideas?
It seems like you ran it correctly, what error did it give you?

In other words what was the output of the job. I just ran it, the same way you said to and it worked fine.

Here is the whole job from start to finish.

Spoiler:
Code:
C:\My Dropbox\CalibreLibrary\Alfred Bester\The Demolished Man (2021)>ebook-meta "The Demolished Man - Alfred Bester.epub" -a "Alfred AAABester"
Original metadata::
Title : The Demolished Man
Author(s) : Alfred Bester [Bester, Alfred]
Publisher : Pocket Books
Book Producer : calibre (0.6.13) [http://calibre-ebook.com]
Comments : SUMMARY:
In a world policed by telepaths, Ben Reich plans to commit a crime that hasn't been heard of in 70 years: murder. That's the only option left for Reich, whose company is losing a 10-year death struggle with rival D'Courtney Enterprises. Terrorized in his dreams by The Man With No Face and driven to the edge after D'Courtney refuses a merger offer, Reich murders his rival and bribes a high-ranking telepath to help him cover his tracks. But while police prefect Lincoln Powell knows Reich is guilty, his telepath's knowledge is a far cry from admissible evidence.
ISBN : 9780671820466
Tags : Science Fiction, Top 100 Sci-fi, Hugo Best Novel
Rating : 8
Timestamp : 2009-09-26T12:59:59+00:00
Published : 2009-09-25T04:00:00+00:00

Changed metadata::
Title : The Demolished Man
Author(s) : Alfred AAABester [AAABester, Alfred]
Publisher : Pocket Books
Book Producer : calibre (0.6.13) [http://calibre-ebook.com]
Comments : SUMMARY:
In a world policed by telepaths, Ben Reich plans to commit a crime that hasn't been heard of in 70 years: murder. That's the only option left for Reich, whose company is losing a 10-year death struggle with rival D'Courtney Enterprises. Terrorized in his dreams by The Man With No Face and driven to the edge after D'Courtney refuses a merger offer, Reich murders his rival and bribes a high-ranking telepath to help him cover his tracks. But while police prefect Lincoln Powell knows Reich is guilty, his telepath's knowledge is a far cry from admissible evidence.
ISBN : 9780671820466
Tags : Science Fiction, Top 100 Sci-fi, Hugo Best Novel
Rating : 8
Timestamp : 2009-09-26T12:59:59+00:00
Published : 2009-09-25T04:00:00+00:00

FYI, I am also using the latest version of Calibre (0.7.12) and my OS is also Windows XP Pro SP3.

One last thought, this changes the metadata in the actual file not in Calibre's metadata.db. So after using ebook-meta to change the metadata in the book the change will not be shown in the Calibre GUI.

I did it once more from the root directory actually specifying a path this time and it still worked fine.

Spoiler:

Code:
C:\>ebook-meta "C:\My Dropbox\CalibreLibrary\Alfred Bester\The Demolished Man (2021)\The Demolished Man - Alfred Bester.epub" -a "Alfred BBBBester"
Original metadata::
Title : The Demolished Man
Author(s) : Alfred AAABester [AAABester, Alfred]
Publisher : Pocket Books
Book Producer : calibre (0.6.13) [http://calibre-ebook.com]
Comments : SUMMARY:
In a world policed by telepaths, Ben Reich plans to commit a crime that hasn't been heard of in 70 years: murder. That's the only option left for Reich, whose company is losing a 10-year death struggle with rival D'Courtney Enterprises. Terrorized in his dreams by The Man With No Face and driven to the edge after D'Courtney refuses a merger offer, Reich murders his rival and bribes a high-ranking telepath to help him cover his tracks. But while police prefect Lincoln Powell knows Reich is guilty, his telepath's knowledge is a far cry from admissible evidence.
ISBN : 9780671820466
Tags : Science Fiction, Top 100 Sci-fi, Hugo Best Novel
Rating : 8
Timestamp : 2009-09-26T12:59:59+00:00
Published : 2009-09-25T04:00:00+00:00

Changed metadata::
Title : The Demolished Man
Author(s) : Alfred BBBBester [BBBBester, Alfred]
Publisher : Pocket Books
Book Producer : calibre (0.6.13) [http://calibre-ebook.com]
Comments : SUMMARY:
In a world policed by telepaths, Ben Reich plans to commit a crime that hasn't been heard of in 70 years: murder. That's the only option left for Reich, whose company is losing a 10-year death struggle with rival D'Courtney Enterprises. Terrorized in his dreams by The Man With No Face and driven to the edge after D'Courtney refuses a merger offer, Reich murders his rival and bribes a high-ranking telepath to help him cover his tracks. But while police prefect Lincoln Powell knows Reich is guilty, his telepath's knowledge is a far cry from admissible evidence.
ISBN : 9780671820466
Tags : Science Fiction, Top 100 Sci-fi, Hugo Best Novel
Rating : 8
Timestamp : 2009-09-26T12:59:59+00:00
Published : 2009-09-25T04:00:00+00:00

Last edited by DoctorOhh; 08-03-2010 at 10:36 PM.
DoctorOhh is offline   Reply With Quote
Old 08-03-2010, 11:06 PM   #5
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: 26,124
Karma: 5101571
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You probably have the option set to only read metadata from filenames.
kovidgoyal is offline   Reply With Quote
Old 08-03-2010, 11:13 PM   #6
mumdigau
Member
mumdigau began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Aug 2010
Device: none
Hi,

I copied the file from Calibre's library to an external location, manipulated it there, deleted the original ebook via GUI in Calibre, and added the modified ebook again.

Here is my call of ebook-meta followed by the output:

Code:
E:\Programme\Calibre\ebook-meta "C:\0051 - Jagd nach dem Leben - Unbekannt.epub" -a "Kurt Brand"

Original-Metadaten::
	Title               : 0051 - Jagd nach dem Leben
	Author(s)           : Jagd nach dem [Unbekannt]
	Book Producer       : calibre (0.6.20) [http://calibre-ebook.com]
	Timestamp           : 2009-10-31T13:08:33+00:00
	Published           : 2009-10-31T13:08:33+00:00

Geänderte Metadaten::
	Title               : 0051 - Jagd nach dem Leben
	Author(s)           : Jagd nach dem [Unbekannt]
	Book Producer       : calibre (0.6.20) [http://calibre-ebook.com]
	Timestamp           : 2009-10-31T13:08:33+00:00
	Published           : 2009-10-31T13:08:33+00:00
Though is partly German you can see that nothing has changed. What is a bit strange is that in the GUI author of the original ebook is shown as 'Unbekannt' (i.e. Unknown), same for author_sort whereas here author contains some part of the title. This is identical to the metatdata shown in the GUI after import of the modified ebook.

Best regards

mumdigau
mumdigau is offline   Reply With Quote
Old 08-04-2010, 03:41 AM   #7
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by kovidgoyal View Post
Quote:
Originally Posted by mumdigau View Post
Though is partly German you can see that nothing has changed. What is a bit strange is that in the GUI author of the original ebook is shown as 'Unbekannt' (i.e. Unknown), same for author_sort whereas here author contains some part of the title. This is identical to the metatdata shown in the GUI after import of the modified ebook.
You probably have the option set to only read metadata from filenames.
Kovid answered the mystery in the post before yours. Even though you are using ebook-meta from the command line the settings in the GUI still hold true. Open Calibre and go to Preferences - Add/Save - Adding Books tab and make sure the box by Read Metadata only from file name is unchecked.
DoctorOhh is offline   Reply With Quote
Old 08-04-2010, 05:26 AM   #8
mumdigau
Member
mumdigau began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Aug 2010
Device: none
I finally got it. I found out that the plugin for writing metadata was deactivated. After activation everything went fine.

Best regards

mumdigau
mumdigau is offline   Reply With Quote
Old 08-04-2010, 07:12 AM   #9
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by mumdigau View Post
I finally got it. I found out that the plugin for writing metadata was deactivated. After activation everything went fine.

Best regards

mumdigau
I thought about that but you were dealing with an epub and I never heard of that plugin being accidentally deactivated. People turn the PDF one off all of the time.

I'm glad you figured it out.
DoctorOhh is offline   Reply With Quote
Old 08-04-2010, 09:39 PM   #10
mumdigau
Member
mumdigau began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Aug 2010
Device: none
Hi,

Everything is running fine here now, except one thing: I can't change the cover via ebook-meta. The old covers stay unchanged. The terminal doesn' t show any error, but on the other side doesn't indicate that there has been a change to the covers:

Code:
Original-Metadaten::
	Title               : 0051 Jagd nach dem Leben
	Title sort          : 0051 Jagd nach dem Leben
	Author(s)           : Kurt Brand [Brand, Kurt]
	Book Producer       : calibre (0.6.20) [http://calibre-ebook.com]
	Series              : Perry Rhodan Heftromane (Erstausgabe) #51
	Timestamp           : 2009-10-31T13:08:33+00:00
	Published           : 2009-10-31T13:08:33+00:00

Geänderte Metadaten::
	Title               : 0051 Jagd nach dem Leben
	Title sort          : 0051 Jagd nach dem Leben
	Author(s)           : Kurt Brand [Brand, Kurt]
	Book Producer       : calibre (0.6.20) [http://calibre-ebook.com]
	Series              : Perry Rhodan Heftromane (Erstausgabe) #51
	Timestamp           : 2009-10-31T13:08:33+00:00
	Published           : 2009-10-31T13:08:33+00:00
I thought there might be a conflict within the parameter declaration for ebook-meta, as all arguments I picked up have a short form which I used (--title --> -t, --authors --> a, --index --> i, etc.), but not --cover (-c goes to comments!). So I switched all parameter declarations to the long form, but that didn't help.

Any idea what's going wrong here?

Best regards

mumdigau
mumdigau is offline   Reply With Quote
Old 08-04-2010, 10:23 PM   #11
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: 26,124
Karma: 5101571
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
setting covers in epub files requires the epub file to properly identify its cover, most epub files do not. And you need calibre 0.7.12
kovidgoyal is offline   Reply With Quote
Old 08-05-2010, 03:45 AM   #12
mumdigau
Member
mumdigau began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Aug 2010
Device: none
Quote:
Originally Posted by kovidgoyal View Post
setting covers in epub files requires the epub file to properly identify its cover, most epub files do not. And you need calibre 0.7.12
What do you mean by 'properly identify'? And how do I check if a epub file is OK on behalf of this?

Via GUI I can change the covers. And yes, I have latest version 0.7.12 installed.

Ciao

mumdigau
mumdigau is offline   Reply With Quote
Old 08-05-2010, 04:23 AM   #13
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by mumdigau View Post
What do you mean by 'properly identify'? And how do I check if a epub file is OK on behalf of this?
Until this version the only way to add a new cover was by converting the file, even epub to epub sufficed. As of this version ebook-meta can change the cover if it is already properly labeled as a cover inside the book. You can open a epub in Sigil, right click on the titlepage then go down to Add Semantics, if cover is checked then this was properly set.

I believe this means that if the cover is not properly set then the only way in calibre to add the cover is to convert the file.
Attached Thumbnails
Click image for larger version

Name:	cover_semantic.png
Views:	74
Size:	154.7 KB
ID:	56172  
DoctorOhh is offline   Reply With Quote
Old 08-05-2010, 08:36 AM   #14
mumdigau
Member
mumdigau began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Aug 2010
Device: none
@dwanthny

Thanks for your explanation. Indeed, the epubs I'm going to add to the library haven't their cover properly set. If I do that in Sigil then the cover will be replaced by ebook-meta.

On the other hand, I tried a simple epub2epub conversion with ebook-convert (no options set besides --cover). This adds the specified image as a cover, the original image is still there, most probably since it isn't properly set as cover, and the new added cover looks somewhat strechted. The old image can easily be removed in Sigil, but in any way I have some manual work with Sigil (apparently there is no batch mode). That makes both procedures more or less infeasible, because I want to add more than 2500 ebooks to the library.

At the moment, I see best chances in adapting the conversion process, i.e. replacing the image (not shure if this is possible), and avoiding that the new cover get stretched (that should be possible through properly set conversion options). Since ebook-convert can modify metadata, too, I could do all my changes in one go.

Ciao

mumdigau
mumdigau is offline   Reply With Quote
Old 08-05-2010, 08:58 PM   #15
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by mumdigau View Post
On the other hand, I tried a simple epub2epub conversion with ebook-convert (no options set besides --cover). This adds the specified image as a cover, the original image is still there, most probably since it isn't properly set as cover, and the new added cover looks somewhat strechted.
There are two settings at play here.

1. In the GUI there is an option under Preferences - Conversion - Structure Detection - if you check remove first image, then the first image will be removed when converting.

2. The image is slightly distorted because it is now rendered as a .SVG image and will stretch to fill the screen. If you prefer an unstretched image where the aspect ratio of the image remains in tact then go to Preferences - Conversion - Epub output. Here you will find two options that will do this. The Preserve cover aspect ratio, leaves the file as svg and it will not stretch to fit the window and thus not be distorted. The other option is to check No SVG cover, this will produce a jpeg for the cover that will not stretch to fit either. Some readers don't handle SVG images and this last option is primarily used for providing covers for those readers.

So to get what you want, run the epub to epub conversion with remove first image and Preserve cover aspect ratio checked. If these are your saved default settings in the GUI they should affect the ebook-convert too.
DoctorOhh 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
How to change source file without re-entering meta data? therealjoeblow Calibre 4 06-29-2010 07:12 PM
Any way to change metadata on Topaz? Sydney's Mom Kindle Formats 2 03-23-2010 04:27 PM
set meta data with ebook-meta and ebook-convert krischik Calibre 6 01-19-2010 11:40 AM
Change Metadata tags en masse thibaulthalpern Calibre 1 03-20-2009 07:02 PM
Can I change path/folder & Q re meta information loss Scotch Calibre 2 12-31-2008 09:27 PM


All times are GMT -4. The time now is 05:47 AM.


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