Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-18-2025, 03:51 PM   #1
hongho71
Connoisseur
hongho71 began at the beginning.
 
Posts: 56
Karma: 16
Join Date: Feb 2015
Device: Kindle Paperwhite
Economist recipe cover page is blank

The Economist recipe cover page shows up blank. Thanks.
hongho71 is offline   Reply With Quote
Old 09-18-2025, 11:58 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: 45,521
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Works for me
Attached Thumbnails
Click image for larger version

Name:	screenshot.png
Views:	60
Size:	312.3 KB
ID:	218159  
kovidgoyal is offline   Reply With Quote
Old 09-20-2025, 12:29 PM   #3
yoyoisbest
Member
yoyoisbest began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Mar 2025
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
Works for me
Hi I have the same issue.

The cover under US is about Israel.

Click image for larger version

Name:	20250920_DE_US.jpg
Views:	10
Size:	317.0 KB
ID:	218182

Failed to download cover
Traceback (most recent call last):
File "calibre/web/feeds/news.py", line 1442, in download_cover
File "calibre/web/feeds/news.py", line 1436, in _download_cover
File "calibre/utils/img.py", line 302, in save_cover_data_to
File "calibre/utils/img.py", line 205, in image_to_data
ValueError: Failed to export image as JPEG with error: Image is empty
yoyoisbest is offline   Reply With Quote
Old 09-20-2025, 08:45 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: 45,521
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That error indicates the server is sending an empty cover image, probably it will be fixed next week automatically, if not let me know.
kovidgoyal is offline   Reply With Quote
Old Today, 11:17 AM   #5
nickredding
onlinenewsreader.net
nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'
 
Posts: 330
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
This is weird ...

The same issue arises with Javascript-based retrieval, although the response seen is "forbidden." Of course the result is also blank, so I suspect Python is not reporting the forbidden status.

The weird thing is, if the url is constructed rater than extracted from the JSON structure, the image is retrieved successfully. I modified the economist recipe as follows.

Code:
            self.cover_url = (
                safe_dict(data, 'props', 'pageProps', 'content', 'cover', 'url')
                .replace(
                    'economist.com/',
                    'economist.com/cdn-cgi/image/width=960,quality=80,format=auto/',
                )
                .replace('SQ_', '')
            )
            self.log('Got embedded cover:', self.cover_url)
            #from datetime import datetime
            #issueDate = datetime.fromisoformat(safe_dict(data, 'props', 'pageProps', 'content', 'issueDate').replace('Z', '+00:00')).strftime("%Y%m%d")
            #self.cover_url = 'https://www.economist.com/cdn-cgi/image/width=960,quality=80,format=auto/content-assets/images/' + issueDate + '_DE_US.jpg'
            #self.log('Got constructed cover:', self.cover_url)
As expected, the cover image does not load. However, if I uncomment the code to get the constructed url, it works, even though the urls appear to be the same. Here is the log output:

Code:
Got embedded cover: https://www.economist.com/cdn-cgi/image/width=960,quality=80,format=auto/content-assets/images/29250920_DE_US.jpg
Got constructed cover: https://www.economist.com/cdn-cgi/image/width=960,quality=80,format=auto/content-assets/images/20250920_DE_US.jpg
I get the same results using Javascript. The string lengths are the same (so there are no hidden characters corrupting the embedded url).

Very strange indeed. If anyone has a theory as to what's happening, let's hear it.
nickredding is offline   Reply With Quote
Old Today, 03: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: 45,521
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Your two URLs are not the same, the filename parts are different.
kovidgoyal is offline   Reply With Quote
Old Today, 04:07 PM   #7
nickredding
onlinenewsreader.net
nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'
 
Posts: 330
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
Yes I see that now. So the embedded url is wrong which is why it doesn't work. I suppose that might get fixed at some point, but until then no economist cover pages will show until the code is modified to remove this fault.
nickredding is offline   Reply With Quote
Reply

Tags
economist


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil adding blank page after cover image ebookn00b Sigil 32 06-20-2013 01:44 PM
Script to scrape page for a cover image for recipe? adoucette Recipes 12 02-29-2012 06:24 PM
better cover for Economist recipe davide125 Recipes 5 11-12-2011 12:33 PM
EPUB Creation: Cover Page blank in ADE Janephew91 ePub 4 09-29-2011 04:18 PM
blank page for cover after converting crestfalleen Calibre 2 06-03-2010 12:08 PM


All times are GMT -4. The time now is 05:03 PM.


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