Adding text to EXIF part of JPG file Log Out | Topics | Search
Moderators | Edit Profile

X-Ways Support Forum » Hex Editing » Adding text to EXIF part of JPG file « Previous Next »

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

Ed Pearson
Posted on Tuesday, Aug 7, 2001 - 0:19:   

I added a template which would allow me to input text to the user comment portion of the EXIF header. Initially, it worked but now an error message says "Invalid Input". I'm using standard text for the comments. What's going on?
Top of pagePrevious messageNext messageBottom of page Link to this message

Stefan Fleischmann (Admin)
Posted on Tuesday, Aug 7, 2001 - 0:30:   

Usually this indicates you have entered a string that is longer than the defined element size.

In case this is not the problem: Can you please post the template definition here or e-mail it? And when exactly does the error occur? (When you edit the text in the template and press ENTER?)
Top of pagePrevious messageNext messageBottom of page Link to this message

Ed Pearson
Posted on Tuesday, Aug 7, 2001 - 3:03:   

Here is the definition of the template.

template "EXIF User Comment"
description "Insert user comments(117 char) into EXIF header" (Line wrapped here but not in temp)
multiple
begin
char[117] "Comment"
end

The entered text was about a dozen characters which is much smaller than the definition. In the past I've used text much longer with no problem. The error shows just after hitting the Enter key after typing the text in the template window.
Top of pagePrevious messageNext messageBottom of page Link to this message

Ed Pearson
Posted on Tuesday, Aug 7, 2001 - 3:30:   

Stefan
I did a reboot and used WinHex before any other program. Now it works but doesn't insert the null terminator after the entered text. I'll keep looking for something that triggers the problem. I need this feature to add comments to JPG's while in the Arctic. I'm already on the road headed that way.
Top of pagePrevious messageNext messageBottom of page Link to this message

Stefan Fleischmann (Admin)
Posted on Tuesday, Aug 7, 2001 - 5:09:   

Sorry, I cannot recreate either problem here. I noticed the cursor keys left and right might not work correctly and have corrected this (http://www.winhex.com/winhex.zip). Will continue to try on systems other than Windows 2000.
Top of pagePrevious messageNext messageBottom of page Link to this message

Ed Pearson
Posted on Tuesday, Aug 7, 2001 - 15:20:   

I downloaded the new file and everything seems to be ok now. I did find some suspicious things though. The WinHex.exe that was replaced had a creation date of 5/30/01, a modified date of 7/14/01, and was V9.92. I had a problem with the previous install regarding version numbers. This file had a size of 469,504 bytes.

I also noticed that the left/right cursors didn't work. Also, the template edit field seemed to be filled with the 125 null terminated spaces that are already in the file. If I inserted more text at the beginning then the field would overflow. Could this be the explanation? The problem has only appeared on my W98se laptop and not the W98 desktop. I also have a ham radio program that misbehaves on this laptop in regard to showing and clearing windows within a program.

I also found in general settings that the Folder for Projects window is prefilled with a single dot and is hard to notice.

Is it necessary to uninstall the previous version before updating? If the main EXE file is the only change could it not be used to overwrite the previous one?

If the previous problem persists I'll collect more data to send you.
Top of pagePrevious messageNext messageBottom of page Link to this message

Ed Pearson
Posted on Tuesday, Aug 7, 2001 - 17:37:   

I think I've found the problem. The default EXIF header from Oly 2100 cameras is filled with 117 spaces(0x20) and a null terminator. When editing this space with a template, it reads these spaces as valid data and puts the text entry in Insert mode. The Insert key will not toggle it to overwrite. As soon as you enter a single character you get buffer overflow and the error message. If the field had less than 117 you could add more to it successfully. The problem now appears to be that the Enter key doesn't add a null terminator and therefore leaves the user comment as full size, 117 char. Also, the Insert key doesn't toggle the function. It's stuck in insert and not overwrite. The W98 desktop was probably in overwrite and therefore didn't see the problem. I know at one point in the past the null terminator worked. Now I have to add it directly in manual control. Therefore, it appears to be two lingering problems, no Insert toggle, and no null terminator.
Top of pagePrevious messageNext messageBottom of page Link to this message

Stefan Fleischmann (Admin)
Posted on Tuesday, Aug 7, 2001 - 18:05:   

1) I do not understand what is suspicious about that old winhex.exe file.

2) Lots of spaces, insert mode in the edit field: Yes, this is probably the explanation.

3) This is by design. In the DOS/Windows world the dot means "current directory" (the directory where the running WinHex installation is installed). You can change the directory to anything you like.

4) No, it is not necessary to uninstall prior to updating, as described on the Additional Information page. However, generally it is recommended to use the setup program again for installing a new version over an existing one.

2nd message: The Enter key does not add a null terminator if there are 117 characters already in the edit box. The Insert key unfortunately never toggles between overwrite and insert in standard edit boxes. I recommend you simply remove all the space characters in the edit box before editing, and then enter your text. Since you probably won't fully utilize the 117 character limit, WinHex will put a null terminator at the end of the text and leave the existing exceeding space characters in the file.
Top of pagePrevious messageNext messageBottom of page Link to this message

Ed Pearson
Posted on Tuesday, Aug 7, 2001 - 18:55:   

1) My suspicion is the creation date. It seems very old for anything in the 9.9 group.

2nd) I assume then that the null is added to the end of all text in the edit window and not at the position of the cursor when Enter is struck. This is how it now behaves. As long as I know this I can make the template work for my EXIF comments.

Thanks for you prompt help.
Top of pagePrevious messageNext messageBottom of page Link to this message

Stefan Fleischmann (Admin)
Posted on Tuesday, Aug 7, 2001 - 19:02:   

The creation date may still be the one of an older winhex.exe file, which was then replaced with the 9.92 one.

Your assumption is correct. The cursor position in the edit box is irrelevant.

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.