Ashampoo / kim

Image metadata manipulation library for Kotlin Multiplatform
https://ashampoo.github.io/kim/
Apache License 2.0
163 stars 8 forks source link

Write exif to heic/avif #54

Closed T8RIN closed 7 months ago

T8RIN commented 8 months ago

Could it be possible? Also for bmp, webp and jxl

StefanOltmann commented 8 months ago

Yes, I believe all those options are feasible.

If we choose to write in HEIC, we will avoid any involvement with proprietary containers and just stay with generic ISOBMFF. Consequently, the "irot" Box (defined in the HEIC specification) would remain unchanged during orientation updates. While this approach is the correct way to effectively alter HEIC orientation, there's a concern that it might utilize technology covered by a patent. HEIC poses a challenge due to its patent implications, so due to these circumstances support will always be lacking until the patents run out around 2035.

On the other hand, AVIF and JXL should present no problems. I need to look into that.

Regarding WebP, we already have a separate issue for that.

I'm curious about your request for BMP since it lacks meaningful metadata. Could you provide more details about your use case?

T8RIN commented 8 months ago

Oh, if bmp doesn't have exif, i have no more questions :) Avif is a heif container based format, so i think that writing and reading exif to heic/heif/avif will be the same

StefanOltmann commented 8 months ago

Avif is a heif container based format

Correction: AVIF and JXL are ISOBMFF formats like HEIF.

They all derive from ISOBMFF. We can safely read and write this base format as all patents must have been expired due to the age of it.

In addition we can write special fields for AVIF & JXL as long as it’s 100% safe that it’s not patented in any way.

HEIC specifies some extra fields: https://nokiatech.github.io/heif/technical.html We won’t read or write those as they may be covered by patents, which is highly likely. I can’t risk legal trouble for my company.

T8RIN commented 8 months ago

Okay :)

StefanOltmann commented 7 months ago

@T8RIN The latest release, v0.10, now includes support for reading AVIF and uncompressed JPEG XL.

To achieve complete JPEG XL support, the integration of a KMP Brotli library is necessary. I hope that Google will provide an official library for this purpose. I have submitted a request for consideration: https://github.com/google/brotli/issues/1123

Regarding the writing support for JXL, it will be implemented when the appropriate time arrives, as JXL's metadata is stored in dedicated ISOBMFF boxes, and there are no patent-related concerns.

In contemplating the writing of HEIC & AVIF, a challenge arises due to the fact that EXIF & XMP metadata is embedded within the mdat container, and the structure of this container is not fully understood (without using knowledge that may be covered by a patent). Consequently, altering this data safely presents difficulties due to the numerous unknowns.

Considering the ambiguous patent situation and the claim that JPEG XL is superior, I assume that HEIC & AVIF might not gain widespread adoption.

T8RIN commented 7 months ago

Okay , thanks:)