Thanks for the replies.
I do use calibredb, called from python. I use 'list -f all --for-machine' as options to get the entire calibre database as json. Then I create the path to the cover file for a book by concatenating the library path on my Mac with the 'authors', 'title', 'id' fields taken directly from the json data.
But when I do so, the path created has characters in it that result in a "file not found" error when I use the path to call Image.open():
Code:
im = Image.open(calibrecoverpath)
That's why I'm confused. The files on disk are accessible to me from Finder or the command line, so the names must be sanitized, but the data from calibredb that I get as json is apparently not.
I manipulate (both read and write) the calibre database using calibredb from within my program in many other ways. In this case, I just want to grab the cover file so I can display it with my program when I show reading stats on a book. I don't see a way to directly get the path to the cover file from calibredb, so I use the individual fields (author, title) to create the path.
What should I do instead?