View Single Post
Old 07-08-2021, 12:09 PM   #2
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: 47,789
Karma: 172313956
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Terry Brown View Post
I have been working on a python program that retrieves information from my Calibre database and acts as a bookmarking tool for syncing my reading location across multiple devices I use to read multiple formats of ebooks, but that don't sync very reliably.

As part of this, I have accessed cover files within the Calibre library file structure.

I am using macOS. In python, I am using the pillow library (from PIL import Image) to read the cover image, convert to a png thumbnail for my use.

The problem is that characters like single and double quotes, commas, non-ascii characters, and so on mean that I cannot get to some of the directories Calibre creates. A good example is the recent book "Ring Shout" by P. Djèlí Clark--the non-standard characters in the author name mean that the PIL library calls using the path I create don't work.

I have tediously fixed all the current problems by manipulating the author names and book titles in Calibre to remove or change the offending characters--not a good solution.

Anyone know how can I manage this in the Python code?
My suspicion is that calibre is already sanitizing (Latinizing??) the non-standard characters to create the filenames. You may have to duplicate this process when creating the file path.
DNSB is offline   Reply With Quote