06-15-2023, 12:45 PM | #1 |
Member
Posts: 22
Karma: 10
Join Date: Mar 2014
Device: Kindle paperwhite 2
|
The Economist - images compressed ?
Hello,
I want to get a smaller version of the Economist with more compressed, low quality images. Starting from: - the original recipe: https://github.com/kovidgoyal/calibr...onomist.recipe - And the Calibre documentation: https://manual.calibre-ebook.com/news_recipe.html I tried to change the following parameters in the recipe (line 195 and following): self.web2disk_options.compress_news_images = True self.web2disk_options.compress_news_images_auto_si ze = 2 self.web2disk_options.compress_news_images_max_siz e = 5 ...But I don't get a smaller Epub as a result (still ~25 Mo) ? Could anyone please help ? Thanks ! |
06-15-2023, 11:23 PM | #2 |
creator of calibre
Posts: 44,006
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You set options as fields directly in your BasicNewsRecipe subclass.
|
Advert | |
|
06-22-2023, 03:14 PM | #3 |
Member
Posts: 22
Karma: 10
Join Date: Mar 2014
Device: Kindle paperwhite 2
|
I tried to add the options under the existing lines from line 195, as follows, but it did not work (I'm not a developer so I only have some basics about coding and I'm a bit lost in the recipe's classes):
def __init__(self, *args, **kwargs): BasicNewsRecipe.__init__(self, *args, **kwargs) if self.output_profile.short_name.startswith('kindle' ): # Reduce image sizes to get file size below amazon's email # sending threshold self.web2disk_options.compress_news_images = True # Code modifié Xav: 2 au lieu de 5 self.web2disk_options.compress_news_images_auto_si ze = 2 # Code modifié Xav ajout de la ligne ci-dessous pour que les images ne dépassent pas 50kb self.web2disk_options.compress_news_images_max_siz e = 50 self.log.warn('Kindle Output profile being used, reducing image quality to keep file size below amazon email threshold') |
06-22-2023, 09:51 PM | #4 |
creator of calibre
Posts: 44,006
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Look at the BasicNewsRecipe class docs, that will tell you the names of the options https://manual.calibre-ebook.com/new...ss_news_images
|
06-23-2023, 05:09 AM | #5 |
Enthusiast
Posts: 48
Karma: 3254262
Join Date: Apr 2023
Device: Kindle
|
Hey @xav, you're on the right track! Don't worry about not being a developer, learning to navigate code can be tricky. It seems like you've understood the instructions from kovidgoyal quite well. I'd suggest to keep reviewing the BasicNewsRecipe class documentation as recommended. Remember that the options need to be set as fields in your subclass, so they should be at the same level of indentation as the 'def __init__' method. And always remember, trial and error is part of the process.
|
Advert | |
|
06-30-2023, 09:33 AM | #6 |
Junior Member
Posts: 1
Karma: 10
Join Date: Jun 2023
Device: kindle white
|
Is it just as effective to configure a default device, so that images get resized? I noticed the Economist download fell from 20MB+ to ~10MB when i set profile to kindle paperwhite
That said, on an older calibre install this news feed was coming in nearer 7MB - not sure what changed (other than that was calibre 5.x) |
07-09-2023, 04:25 PM | #7 | |
Member
Posts: 22
Karma: 10
Join Date: Mar 2014
Device: Kindle paperwhite 2
|
Quote:
Thank you very much again ! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF is being compressed when being sent to Kobo device. | zorrodee666 | Calibre Companion | 2 | 03-24-2019 02:15 AM |
Compressed elements in libnickel.so | PeterT | Kobo Developer's Corner | 5 | 10-05-2013 05:21 PM |
Compressed Book Summaries | Tony30 | Deals and Resources (No Self-Promotion or Affiliate Links) | 1 | 02-25-2013 07:57 AM |
Compressed Manga | albogango | Sony Reader | 10 | 09-09-2011 10:57 PM |
The Economist recipe images are too large | santino1980 | Recipes | 4 | 11-01-2010 03:35 PM |