Replace EXIF User Comment in JPG pict... Log Out | Topics | Search
Moderators | Edit Profile

X-Ways Support Forum » Hex Editing » Replace EXIF User Comment in JPG picture files « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Ed Pearson
Posted on Sunday, May 27, 2001 - 21:31:   

I need to replace the filler data in the User Comment field of an EXIF/JPG file with text. The field is filled by the camera with the following data, 0x00(8), 0x20(117), 0x00(1). The leading 0x00's are apparently an attempt to be sure the dummy and empty string is null terminated. Most of the field are spaces. The last 0x00 is apparently another attempt to create a null terminated field in case the first block of 0x00's gets overwritten.

I want to open the picture file, go to offset 0x2a6, and type the text comments. At the end of the text I want to insert a 0x00 to null terminate. I either want to watch the text insertion on the right-hand panel or have some warning that I have used my 125 character limit and leave the final 0x00 in place. How can I easily do this?
Top of pagePrevious messageNext messageBottom of page Link to this message

Stefan Fleischmann (Admin)
Posted on Sunday, May 27, 2001 - 21:41:   

I suggest you create a simple template, e.g. like this:

template "EXIF User Comment in JPG"
description "Allows 125 characters to be entered at max."
begin
char[125] "User comment"
end

(to be saved as a text file in your WinHex directory)

This will not allow to save a string longer than 125 characters and will automatically insert a null character at the end of the string if it is shorter than 125 characters. Open the template with the Template Manager when the cursor is at the beginning of the user comments field in the regular edit window.
Top of pagePrevious messageNext messageBottom of page Link to this message

Fred Vtt
Username: fmarango

Registered: N/A
Posted on Monday, Mar 17, 2008 - 17:16:   

Hi there,
The Tag User comment can't have more then 125 characters ?
Are there any tags that would allow several kilobytes of data ?
Thanks
Fred
Top of pagePrevious messageNext messageBottom of page Link to this message

Alfons Kramer
Username: admin3

Registered: 4-2004
Posted on Tuesday, Mar 18, 2008 - 10:44:   

They can. EXIF Tags are implemented as Pascal Strings with a 16-Bit Length field. This makes it possible to store almost 64 KB of data in one tag field.

The 125 chars are a limitation of the specific template implementation.

WinHex above 14.4 uses metadata extraction to deal with EXIF Tags and can handle Tags up to 64 KB.
Top of pagePrevious messageNext messageBottom of page Link to this message

Fred Vtt
Username: fmarango

Registered: N/A
Posted on Wednesday, Mar 19, 2008 - 10:35:   

Thanks so much for your answer.
I can't beleive that you replied so fast where as the initial message was post 7 years ago ! Way to be reactive !
One more questions, you said that TAGS can be as big as 64 KB but I thought that the application market segment (APP1) cant exceed 64 KB to fit the JPEG standard (APP1 includes many tags).
My question is : how big can the user comment tag can be ? If the APP1 is limited to 64 KB, Can the user comment take most of it and am I allowed to remove some other tags that I don't use to fit in the 64 KB ?
Thanks for your help,
Fred

Add Your Message Here
Post:
Username: Posting Information:
Only registered users may post messages here, i.e. you need to have an account.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:
Forum operated by X-Ways Software Technology AG.