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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-02-2013, 08:21 AM   #1
tdido
Junior Member
tdido began at the beginning.
 
Posts: 8
Karma: 12
Join Date: Jun 2009
Device: Sony PRS-T1
Recipe for Le Monde Diplomatique, edición Cono Sur (Argentina)

Greets, all.

I've taken my first shot at writing a recipe. It's for fetching Le Monde Diplomatique edición Cono Sur (Argentina), which is in Spanish. It requires a subscription. You can find the recipe here.

I'd welcome any feedback if anyone finds it useful.

Cheers!

Last edited by tdido; 01-02-2013 at 08:21 AM. Reason: typo
tdido is offline   Reply With Quote
Old 01-02-2013, 01:10 PM   #2
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: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You've got some linux specific code in there for getting covers, that should be removed.
kovidgoyal is offline   Reply With Quote
Old 01-02-2013, 03:36 PM   #3
tdido
Junior Member
tdido began at the beginning.
 
Posts: 8
Karma: 12
Join Date: Jun 2009
Device: Sony PRS-T1
Quote:
Originally Posted by kovidgoyal View Post
You've got some linux specific code in there for getting covers, that should be removed.
Ah, yes, thank you for pointing that out. I've now replaced the fixed UNIX style path with a Python tempfile.

I'll try to test the recipe in a Windows machine as soon as I get access to one.

Cheers!

Last edited by tdido; 01-02-2013 at 04:21 PM.
tdido is offline   Reply With Quote
Old 01-02-2013, 10:53 PM   #4
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: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Couple of things:

1) Dont use NamedTemporaryFile, use one of the functions from calibre.ptempfile instead as they handle temp file locations in a consistent manner.

2) Dont use PIL, use the save_cover_data_to function from calibre/utils/magick/draw.py it is more robust (PIL is unmaintained, that function uses ImageMagick).
kovidgoyal is offline   Reply With Quote
Old 01-03-2013, 07:50 AM   #5
tdido
Junior Member
tdido began at the beginning.
 
Posts: 8
Karma: 12
Join Date: Jun 2009
Device: Sony PRS-T1
Quote:
Originally Posted by kovidgoyal View Post
1) Dont use NamedTemporaryFile, use one of the functions from calibre.ptempfile instead as they handle temp file locations in a consistent manner.
Great, I'll change that. Thanks for the tip.

Quote:
Originally Posted by kovidgoyal View Post
2) Dont use PIL, use the save_cover_data_to function from calibre/utils/magick/draw.py it is more robust (PIL is unmaintained, that function uses ImageMagick).
Will do. One question though: what would be the best way to handle the cropping? The cover file, as available in the website, also contains the back cover, which should be removed.

Thanks!
tdido is offline   Reply With Quote
Old 01-03-2013, 10:42 PM   #6
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: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use minify_image and apss the resulting image object to save_cover_data
kovidgoyal is offline   Reply With Quote
Old 01-05-2013, 11:10 AM   #7
tdido
Junior Member
tdido began at the beginning.
 
Posts: 8
Karma: 12
Join Date: Jun 2009
Device: Sony PRS-T1
In the end I used your "Image" wrapper class, which provides a "crop" and a "save" methods, exactly what I needed. No optional Python modules used anymore

Thanks for the help, and let me know if there's anything else that could be improved.

Cheers!
tdido is offline   Reply With Quote
Old 01-05-2013, 12:59 PM   #8
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: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Merged.
kovidgoyal is offline   Reply With Quote
Reply

Tags
calibre, calibre recipes, news

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Le Monde Diplomatique en Esperanto btab Recipes 0 01-02-2013 04:07 AM
Recipe for Le Monde subscribers? Thomas92 Recipes 0 12-27-2011 04:50 AM
recipe doesn't read my Le Monde Diplomatique subscription! dolcem Recipes 1 10-16-2011 07:25 PM
Improved recipe for Le Monde veezh Recipes 0 02-25-2011 04:14 AM
E-Books Le monde du 6 Novembre sur les livres numériques aceflor Forum Français 5 11-15-2010 06:46 AM


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


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