Exif / XMP support
* avifImage can now hold Exif and XMP metadata (`avifImageSetMetadataExif`, `avifImageSetMetadataXMP`)
* Support for reading/writing Exif and XMP items
* Now tracking idat boxes across meta boxes
* Support for iloc construction_method 1 (idat)
* Proper handling of the primary item box (pitm) on read
diff --git a/include/avif/avif.h b/include/avif/avif.h
index ee55c53..b079ae8 100644
--- a/include/avif/avif.h
+++ b/include/avif/avif.h
@@ -300,6 +300,10 @@
avifProfileFormat profileFormat;
avifRWData icc;
avifNclxColorProfile nclx;
+
+ // Metadata - set with avifImageSetMetadata*() before write, check .size>0 for existence after read
+ avifRWData exif;
+ avifRWData xmp;
} avifImage;
avifImage * avifImageCreate(int width, int height, int depth, avifPixelFormat yuvFormat);
@@ -311,6 +315,9 @@
void avifImageSetProfileICC(avifImage * image, const uint8_t * icc, size_t iccSize);
void avifImageSetProfileNCLX(avifImage * image, avifNclxColorProfile * nclx);
+void avifImageSetMetadataExif(avifImage * image, const uint8_t * exif, size_t exifSize);
+void avifImageSetMetadataXMP(avifImage * image, const uint8_t * xmp, size_t xmpSize);
+
void avifImageAllocatePlanes(avifImage * image, uint32_t planes); // Ignores any pre-existing planes
void avifImageFreePlanes(avifImage * image, uint32_t planes); // Ignores already-freed planes
diff --git a/include/avif/internal.h b/include/avif/internal.h
index c0bee2d..f4d39ed 100644
--- a/include/avif/internal.h
+++ b/include/avif/internal.h
@@ -21,11 +21,13 @@
} while (0)
// ---------------------------------------------------------------------------
-// URNs
+// URNs and Content-Types
#define URN_ALPHA0 "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha"
#define URN_ALPHA1 "urn:mpeg:hevc:2015:auxid:1"
+#define CONTENT_TYPE_XMP "application/rdf+xml"
+
// ---------------------------------------------------------------------------
// Utils