I've a little code that attempts to split a multi-page tiff into single tiffs (or single whatever, can be jpeg, gif, png), but I'm getting the following exception: End of data reached before next EOL.
Just a guess, but that suggests to me that the input file is corrupted in some way. Since the message mentions "end of data" then perhaps the file has been truncated.
Hi, this topic is old so I guess you fixed your problem but I'll give more info in case it happens to someone else : I had the same error while trying to do the same thing. In my process I had Apache FOP generating a multipage TIFF file, then I split it into single page TIFFs using more or less the same code as you. For some reason FOP sometimes returned a corrupted multipage TIFF, and JAI returned this InvocationTargetException . I advise you to use tools like AsTiffTagViewer to analyze the header of the TIFF files you have in input, you may be able to find some anomalies (as a corrupted TIFF can still be readable in image viewers).
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
a bit of art, as a gift, the permaculture playing cards