Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Getting / Saving Unique ImageID
meigs
#1 Posted : Monday, 4 January 2010 1:45:42 PM(UTC)
Rank: Advanced Member

Joined: 16/03/2008(UTC)
Posts: 85
Man
Location: Pennsylvania

I am working to index my photos in GSP. I have written some simple additional pages based on the GSP model - it all works very well and is very simple. At a later date I will post some of what i have learned for others.

I am wondering if you know the answer to the unique picture ID question. You have in the database a unique hash key that is generated. I would like to get a unique key in the picture file itself and move to putting various comments / information into the jpg file directly. What I have found is that in Picasa when I right click on a picture and look at properties there is a unique 32 character (I think) ASCII id. Also in windows if I right click on a jpeg file under image there is a field Image ID which matches what i see in Picasa. I am not sure how and what programs generate this id.

I have searched through the system.drawing.* object model and can't directly find how to set / read the unique image ID property. It seems to be around the web but I cant find a simple example of how to do this.

This seems like an incredibly useful capability ... to have a unique GUID for each file that can be used as the basis for indexing / retrieving photo files so the name / directory combination is required and which is very prone to failure.

Do you have more program details? Is this something that is planned for future updates? thanks!
Roger Martin
#2 Posted : Monday, 4 January 2010 1:58:31 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,168
Location: Fort Atkinson, WI

I don't know anything about the ID you are seeing in your images. I wonder if they are truly globally unique.

As you noticed, GSP creates a unique ID that is based on the file's name and its creation timestamp. A special algorithm updates the file's creation timestamp if necessary to guarantee a unique hash key within the gallery.

The only time GSP uses the key is during synchronization, as it helps GSP re-link a file to its database record if the user moves it to another directory outside of GSP (such as with Win Explorer).

There are no plans to change this.

I have not yet found a good, reliable way (using 100% managed code) to write metadata back to a file. Let me know if you do.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
meigs
#3 Posted : Monday, 4 January 2010 3:02:11 PM(UTC)
Rank: Advanced Member

Joined: 16/03/2008(UTC)
Posts: 85
Man
Location: Pennsylvania

I am not sure if it is unique or not. What is more useful is to be able to assign a unique ID and use the field defined for future reference. What I have found is a utility that seems to work pretty well which I have been using to update a number of my photos is ExifWorks : "ExifWorks is a class written in 100% pure managed VB.NET, which allows comfort reading and writing of embedded EXIF metadata."

http://www.codeproject.com/KB/vb/exif_reader.aspx

A definition is here:

http://www.awaresystems....gs/privateifd/exif.html

The last item in the list is "ImageUniqueID" which is code 42016. I inserted this into the ExifWorks program and added a new function and tested it. It reads the unique ID field and also writes it. It appears to simply be an ascii field 32 characters long. If you took something like this you could use it to put the GUID into it so that there is a direct unambiguous link between the database and the picture file. What seems to be the case, but I am not sure, is that this is an official field for storing a uniqueID for a picture.

I also changed the GetHashKeyUnique function to the following line:

hashKey = System.Guid.NewGuid().ToString().Replace("-", "").ToUpper();

This creates a 32 character ASCII string from a GUID that can be directly using in the IMAGEID field in the picture.

I believe having the ability to capture some basic comments about pictures and embed in the file would be really useful for longer term archiving of photos.

If I learn anything else I will update.

Thanks.
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.