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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-18-2019, 09:55 AM   #1
halfbeep
Junior Member
halfbeep began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2019
Device: calibre web content server
web content server cover.jpg error

I can convert, upload ebooks that appear to pass all checks and run all okay in local ebook reader and 3rd party book readers. The 'cover.jpg's are in the correct location outside the epub. I have tried formats png and jpg

When browsing the content server my cover image for any book shows as a broken image in the browser. Server log reports this error:-

Unhandled exception in state: State: _job_done Client: 81.98.188.151:59964 Request: GET /get/thumb/2/Past_Papers?sz=600x800 HTTP/1.1
Traceback (most recent call last):
File "/root/calibre/src/calibre/srv/loop.py", line 569, in tick
conn.handle_event(event)
File "/root/calibre/src/calibre/srv/loop.py", line 308, in _job_done
self.job_done(*event)
File "/root/calibre/src/calibre/srv/http_response.py", line 495, in job_done
reraise(etype, e, tb)
File "/root/calibre/src/calibre/srv/pool.py", line 35, in run
result = func()
File "/root/calibre/src/calibre/srv/http_response.py", line 452, in run_request_handler
result = self.request_handler(data)
File "/root/calibre/src/calibre/srv/routes.py", line 317, in dispatch
ans = endpoint_(self.ctx, data, *args)
File "/root/calibre/src/calibre/srv/content.py", line 326, in get
return cover(ctx, rd, library_id, db, book_id, width=w, height=h)
File "/root/calibre/src/calibre/srv/content.py", line 156, in cover
return create_file_copy(ctx, rd, prefix, library_id, book_id, 'jpg', mtime, copy_func)
File "/root/calibre/src/calibre/srv/content.py", line 98, in create_file_copy
copy_func(ans)
File "/root/calibre/src/calibre/srv/content.py", line 154, in copy_func
data = scale_image(buf.getvalue(), width=width, height=height, compression_quality=quality)[-1]
File "/root/calibre/src/calibre/utils/img.py", line 374, in scale_image
img = image_from_data(data)
File "/root/calibre/src/calibre/utils/img.py", line 88, in image_from_data
raise NotImage('Not a valid image (detected type: {})'.format(q))
NotImage: Not a valid image (detected type: None)

Has anyone else seen this issue? The cover.jpg image is not being found or interpreted correctly. If I delete the cover.jpg file, the error persists same

Any help appreciated. Thx
halfbeep is offline   Reply With Quote
Old 08-18-2019, 10:44 AM   #2
halfbeep
Junior Member
halfbeep began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2019
Device: calibre web content server
similar error with pdfs in browser

when viewing pdf in browser, a broken image is also appearing as the first page of the book, i think this console error is connected:-

Traceback (most recent call last):
File "/root/calibre/src/calibre/db/cache.py", line 1322, in set_metadata
self._set_cover({book_id: cdata})
File "/root/calibre/src/calibre/db/cache.py", line 1247, in set_cover
self.backend.set_cover(book_id, path, data)
File "/root/calibre/src/calibre/db/backend.py", line 1446, in set_cover
save_cover_data_to(data, path)
File "/root/calibre/src/calibre/utils/img.py", line 252, in save_cover_data_to
f.write(image_to_data(img, compression_quality, fmt, compression_quality // 10) if changed else data)
File "/root/calibre/src/calibre/utils/img.py", line 164, in image_to_data
raise ValueError('Failed to export image as ' + fmt + ' with error: ' + w.errorString())
ValueError: Failed to export image as JPEG with error: Unsupported image format
halfbeep is offline   Reply With Quote
Old 08-18-2019, 12:01 PM   #3
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: 35,332
Karma: 12711906
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That means your Qt is missing image support.
kovidgoyal is offline   Reply With Quote
Old 08-26-2019, 09:15 AM   #4
halfbeep
Junior Member
halfbeep began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2019
Device: calibre web content server
Talking Help

Kovid, many thanks - I rebuilt from source ensuring compatibility between python, Qt etc. and Calibre seems to be working fine. Thank you

One last niggly annoying issue is that often the online and desktop conversions fail -> HTML and -> PDF or EPUB. 99% of the failures are due to poor input formats which either fail or cause the the conversion process to hang

1. Is there a way to optimise conversions in a less complex method than heuristics (trial & error) ? Or at least, fail earlier and prevent the hanging

2) Is it possible to pre-check artefacts at upload time (to my public content server) to make sure the format is good enough for successful conversions?

Good job. Thx
halfbeep is offline   Reply With Quote
Reply

Tags
cover, cover browser, cover for ebook, cover format, cover image

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Server - Web jojovee Development 2 08-16-2017 02:56 PM
Calibre 3 content web server problem astergiou Calibre 6 07-29-2017 02:56 AM
Modilying content server web settings BoundforPNG Calibre 1 06-29-2015 02:53 AM
500 Internal Server Error accessing content server Calibre 0.8.8 DaddyO57 Calibre 1 07-20-2012 06:08 PM
Web Content Server mezme Calibre 7 01-08-2010 09:59 PM


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


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