For trying to grab images I am trying to do book.getCoverPage or book.getCoverImage. However on book.getCoverPage or book.getCoverImage which then returns a l.siegman type "Resource" which then I try to get the actual image using book.getCoverImage.getData() which returns a byte[].
I tried doing this
byte[] data = bookLoaded().getCoverPage().getData();
Bitmap bmp = BitmapFactory.decodeByteArray(data, 0, data.length);
image_view.setImageBitmap(bmp); //No output.
I even tried treating it as a folder and tried to get the image out of it.
try{
AssetManager am;
String fileLoc = bookLoaded().getCoverPage().getHref();
String fileComplete = bookName + "/" + fileLoc;
Log.i("Text Location Details: ", fileComplete);
TextView tv = (TextView)findViewById(
R.id.tv);
tv.setText(fileComplete);
Bitmap bmp = BitmapFactory.decodeFile(fileComplete);
image_view.setImageBitmap(bmp);
}catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}//Doesn't work since epubs are technically zip files which has a bunch of html pages.
I also tried different things: "
http://stackoverflow.com/questions/9163627/loading-resource-to-bitmap-which-resource-is-taken-from-an-nl-siegmann-epublib"
I still am doing more researching.
public Book bookLoaded(){
AssetManager am = getAssets();
try{
InputStream is = am.open(bookName5);
book = (new EpubReader()).readEpub(is);
}catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
return book;