Author Topic: Add comment on image file header  (Read 3729 times)

Nikunj Agola

  • Newbie
  • *
  • Posts: 4
Add comment on image file header
« on: April 21, 2017, 07:10:07 AM »
I am working on an iOS application and in this application, I want to add a comment(s) in image file header. As I able to add a comment on EXIF metadata under UserComment but I want to add multiple comments in the image file header under "Comment" key.

Which framework do I use? For UserComment, I am using the ImageIO framework. Please read this link s000.tinyupload.com/?file_id=00209075531742860207

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15224
    • ExifTool Home Page
Re: Add comment on image file header
« Reply #1 on: April 21, 2017, 07:12:47 AM »
I think this is FAQ 3

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Nikunj Agola

  • Newbie
  • *
  • Posts: 4
Re: Add comment on image file header
« Reply #2 on: April 21, 2017, 07:23:47 AM »
Thank you, Phil, for your quick reply,

But we want to write and read "JPEG Comment (COM segment)" in an iOS mobile application. I have also searched XMP and Is it any comment section or tag to extract "JPEG Comment (COM segment)"?

Thanks in advance  :)

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15224
    • ExifTool Home Page
Re: Add comment on image file header
« Reply #3 on: April 21, 2017, 07:38:18 AM »
Oh, I see.  You want to do this on iOS and you can't run ExifTool there.  I'm running ExifTool on my iOS device, and it was easy for me to do, but it would probably be a lot harder if the device isn't jailbroken.  But if you just want to read the COM segment it should be very simple to just open the JPEG and parse it yourself using standard file i/o.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Nikunj Agola

  • Newbie
  • *
  • Posts: 4
Re: Add comment on image file header
« Reply #4 on: May 09, 2017, 12:31:47 AM »
Hello Phil,

Thank you so much for your answer as you said I am able to fetch COM segment and also add/edit comments but I have one query. If an image has not a single COM segment then in which index I have to add COM segment? Another point is when I am trying to modify COM segment of Captured image from iPhone device there are error message popped up that "Unable to save changes -  An error occur while saving"

I have attached a link to JPEG file format http://s000.tinyupload.com/?file_id=42277708729639142098

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15224
    • ExifTool Home Page
Re: Add comment on image file header
« Reply #5 on: May 09, 2017, 07:09:45 AM »
ExifTool combines multiple COM segments into a single Comment when extracting, and will create multiple COM segments when writing if the comment exceeds 64 kB in length.

I don't know about that error message -- it isn't from ExifTool.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Nikunj Agola

  • Newbie
  • *
  • Posts: 4
Re: Add comment on image file header
« Reply #6 on: May 09, 2017, 08:11:41 AM »
Ok, But in which index you add COM segments in ExifTool?

No error message isn't from EXifTools but it comes when I am trying to add COM segment of captured image from iOS Camera.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15224
    • ExifTool Home Page
Re: Add comment on image file header
« Reply #7 on: May 09, 2017, 08:12:48 AM »
Ok, But in which index you add COM segments?

Sorry, but I don't understand the question.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).