dragon66 / icafe

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

Anyway to write the exif back to the original image? #67

Closed ivanooi closed 6 years ago

ivanooi commented 6 years ago

Hi,

Is there anyway to write the exif back to the source/ original image? instead of create another one.

Thanks Ivan

dragon66 commented 6 years ago

@ivanooi As manipulating metadata involving copy the content from the original image to the resulting image and inserting new content to the resulting image all at the same time, you can't do it with the same source.

The only way I can come up is to use a temp file to hold the resulting image and in the end, you can either delete the original image, rename the temp file to the original one or move the original image somewhere else and do the rename. Anyway, be very careful to keep a copy of the original image.

Wen

ivanooi commented 6 years ago

I see...how bout turn the source into byte array? Will that help?

Thank you so much Ivan

dragon66 commented 6 years ago

@ivanooi Do you mean read the source into a byte array and then override the source? Probably fine but sounds fishy and definitely not a good idea for production.

ivanooi commented 6 years ago

I see ...Thanks !