• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Split multi-page tiff throwing: End of data reached before next EOL

 
Raul Medina
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

The code I'm using:



And the FULL exception log:



Thank you for you help!
 
Paul Clapham
Sheriff
Pie
Posts: 20166
24
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Fabrice Barotin
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic