dragon66 / icafe

Java library for reading, writing, converting and manipulating images and metadata
Eclipse Public License 1.0
204 stars 58 forks source link

JPEGTweaker.insertMetadata throws NullPointerException #60

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hello,

in icafe-1.1-SNAPSHOT in class JPEGTweaker a NullPointerException may occur in function insertMetadata( starting at line 1063).

if(eightBIMStream != null) { ... } eightBIMStream.reset();

Calling eightBIMStream.reset() outside the null check resulted in a NullPointerException. It would be wise to add an else condition to create a new ByteArrayOutputStream to ensure eightBIMStream is not null if we want to work with it in the following lines.

Sincerely yours, Stefan

dragon66 commented 6 years ago

@StefanGohlke Thanks for pointing this out. I have changed the code and checked in. I have some issue publish on Maven though.