Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For image Metadata, what tag allows for the largest character limit?

For example the Exif standard has a "User Comment" tag that has a limit of 256 characters I believe.

If I want to add lets say a story into metadata, what would be my best bet for several megabytes worth of text.

Basically I'm trying to store certain things inside of an image and have it not lost when transferred between iPhones. I wrote this image directly into the image before by converting it into NSData and then appending the huge string and then changing the NSData to UIImage. This worked but when I emailed, texted, or placed it inside the photolibrary, all information I added was lost.

Apparently metadata stays with the image and I have it working using user comment but there is a character limit.

How would I go about using an existing tag or making my own so I can have almost no limit on the text size? I don't care how big the file gets.

like image 536
SolidSnake4444 Avatar asked Oct 19 '25 13:10

SolidSnake4444


1 Answers

I will assume you are talking about JPEG images because the file format is central to this question.

JPEG images have an inherent 64kB segment-size limit. The EXIF UserComment has no length limit, but EXIF is limited to a single JPEG segment, so it is restricted to 64kB.

Some metadata editors (like ExifTool) support multi-segment metadata types. Both XMP and JPEG comments may span multiple segments. I would suggest simply using the JPEG Comment because multi-segment support of XMP is probably not very common. If you choose XMP, something like the XMP-dc:Description tag may be suitable.

like image 170
Phil Harvey Avatar answered Oct 22 '25 07:10

Phil Harvey