Java isn't reading a JPG image where as a photo viewer can read it -
i have scraped few images website. scraper did not download image files correct extension.
i changed 1 of file's extension ".jpg"
, opened in picasa. wrote java program change downloaded image file extensions ".jpg"
.
now when tried open images in java, using swing
, it's not displaying image. using code display. working fine other images downloaded manually web.
string path = "resources\\images\\"+gameplayer.getname()+".jpg"; jlabel image = new jlabel(new imageicon(path));
i tried converting image files different format third part software(format factory) couldn't read file. can open , view images in picasa.
how display scraped images incorrect extensions using swing
?
picassa inspecting file signature (https://en.wikipedia.org/wiki/list_of_file_signatures) rather file extension , therefore opens correctly. can't rename file , expect code understand how open/display it.
Comments
Post a Comment