sephiroth74 / Android-Exif-Extended

Exif extended library for Android, based on jhead c library (http://www.sentex.net/~mwandel/jhead/)
Other
135 stars 45 forks source link

Function to write to a stream rather than file #15

Open BenStorey opened 8 years ago

BenStorey commented 8 years ago

Hello,

Thanks for putting this library together. For a project I'm working on I put everything through an encryption cipher before writing anything to disk, so only having writeExif functions that write to a file makes things a little more difficult. Could you expose a function in ExifInterface that writes to a stream rather than an output file?

For my project I've just included your source entirely and added this function, which seems to work for my needs:

public void writeExif(final InputStream input, final OutputStream output) throws IOException
{
    writeExif_internal(input, output, mData);
    IOUtils.copy(input, output);
    output.flush();
    output.close();
}

Thanks!

(I would have done a pull request but I'm not really familiar with how to do them properly, so for such a small snippet have just included here!)

sephiroth74 commented 8 years ago

Hi, can you create a pull request?

BenStorey commented 4 years ago

Sure, thanks!

https://github.com/sephiroth74/Android-Exif-Extended/pull/24