Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XBMC thumbnails fail to render #391

Open
wiggin15 opened this issue Oct 8, 2017 · 0 comments
Open

XBMC thumbnails fail to render #391

wiggin15 opened this issue Oct 8, 2017 · 0 comments

Comments

@wiggin15
Copy link
Contributor

wiggin15 commented Oct 8, 2017

In XBMC view, the thumbnails of movies and TV shows fail to render:

screen shot 2017-10-07 at 23 53 18

The URI for xbmc/GetThumb raises the following exception:

2017-10-07 23:40:57 :: cherrypy.error.140245003550160 :: ERROR :: [07/Oct/2017:23:40:57] HTTP Traceback (most recent call last):
  File "/opt/htpc-manager/libs/cherrypy/_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "/opt/htpc-manager/libs/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/opt/htpc-manager/libs/cherrypy/_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/opt/htpc-manager/modules/xbmc.py", line 215, in GetThumb
    return get_image(url, h, w, o, self.auth())
  File "/opt/htpc-manager/htpc/proxy.py", line 51, in get_image
    resize_image(image, height, width, opacity, resized)
  File "/opt/htpc-manager/htpc/proxy.py", line 107, in resize_image
    im.save(dest, imagetype)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1453, in save
    raise KeyError(ext) # unknown extension
KeyError: u'.0'

Using debug mode, I found that imagetype is None in proxy.py:resize_image, leaving PIL to try to determine the image file format from the filename, which ends with ".0" (the filename is created from the image properties. .0 is the opacity - so not helpful). There is an open Python issue about imghdr failing to detect the JPEG format: https://bugs.python.org/issue28591
We can use PIL itself to determine imagetype instead of using imghdr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant