-
I found that on some phones I didn't have to use the path directly but use contentResolver to work with the files. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Hi, Thanks for reaching out. How large is the file you're trying to update? Can you share an example? To update the file, its bytes must fit twice into the heap memory. The logic in At one point, both the original and modified bytes exist in heap memory. If your JPG is around 20 MB, this can be problematic, especially on Android devices. Ideally, I’d like to rewrite this logic to manipulate a stream directly - avoiding large byte arrays in heap memory - while also enabling simultaneous updates to EXIF, IPTC, and XMP metadata. However, my initial focus was on understanding the file formats and converting Apache Commons Imaging 1:1 to Kotlin was a safe way to use tried & tested logic in production. Now, it’s a matter of finding the time amid other priorities. The recent library changes were all related to new features in Ashampoo Photo Organizer. I hope this helps clarify things. Best regards, Stefan |
Beta Was this translation helpful? Give feedback.
So I managed to make it work, here's my PR for my code.
https://gitlab.com/ravenfeld/baba/-/merge_requests/82
What interests you is
KimExt.kt
andFileSystemServiceImpl.kt
For Android 9 and then for all of them, I had to use
ByteArrayByteWriter()
because I couldn't useupdate
orupdateExifMetadataLossless
. The phones were spitting without a message.In
FileSystemServiceImpl
, you can find myReader
andWriter
that I use for AndroidIn any case, thank you very much for your lib, which allows me to manipulate exifs very easily.