Bug #661

VideoLib is failing to retrieve poster art

Added by Hammel about 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:09 Aug 2018
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:Database
Target version:PiBox - 1.0 - Atreides
Severity:05 - Very Low

Description

Here is a sample log.

18089:164118.006 [ Timer-4] INFO            TVDB Request URL: http://thetvdb.com/banners/episodes/260315/4880309.jpg
18089:164118.023 [ Timer-4] ERROR           TVDB Error making HTTP request: image == null!
java.lang.IllegalArgumentException: image == null!
    at javax.imageio.ImageTypeSpecifier.createFromRenderedImage(ImageTypeSpecifier.java:925)
    at javax.imageio.ImageIO.getWriter(ImageIO.java:1592)
    at javax.imageio.ImageIO.write(ImageIO.java:1520)
    at com.ximba.videolib.TVDB.requestImage(TVDB.java:504)
    at com.ximba.videolib.TVDB.updateEntry(TVDB.java:547)
    at com.ximba.videolib.TVDB.queryDB(TVDB.java:572)
    at com.ximba.videolib.UI$ScanTV.run(UI.java:299)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

Which appears to be this bit of code:

            URL url = new URL(urlStr);
            BufferedImage image = ImageIO.read(url);
            if ( ImageIO.write(image, "png", new File( fileName ) ) )
                return;
            else
                log.error("Failed write - no image appropriate write available.");

So either the "new URL" fails to generate a proper URL for ImageIO or ImageIO.read() has change syntax or something.

Associated revisions

Revision 021d6188
Added by Hammel about 2 years ago

RM #661: Switch to using https when downloading images from TheMovieDB.org and TheTVDB.com, even if their metadata still
uses http.

Revision 021d6188
Added by Hammel about 2 years ago

RM #661: Switch to using https when downloading images from TheMovieDB.org and TheTVDB.com, even if their metadata still
uses http.

History

#1 Updated by Hammel about 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Their API returns a link that is "http" but that redirects to "https" and ImageIO doesn't handle that. The solution, since I know https works with both TheMovieDB.org and TheTVDB.com, is to simply replace any leading "http:" with "https:" before retrieving the image. Problem solved.

Tested, committed and pushed.

Closing issue.

Also available in: Atom PDF