Friday, June 20, 2008

Ok,  so here’s the scoop.

I’ve been playing around with adding location EXIF tags to a photo taken on a Windows Mobile device.  I’ve reached the conclusion that reading tags is not that difficult but writing them can be a pain in the bottom.

So, I’m thinking, about using a web-service to post pictures from the mobile device along with the location the picture was taken and letting the full framework add the required EXIF tags and save it to the photo sharing/blog of your choice.

So its early days (as I’m a newbie to this),  but here's the bit of full framework code that lists the EXIF tags and the bit commented out at the bottom shows how to add a simple tag.

            Image theImage = new Bitmap(@"someimage.jpg");

            // Get the PropertyItems property from image.
            PropertyItem[] propItems = theImage.PropertyItems;

            foreach (PropertyItem i in propItems)
            {
                if (i.Type == 2 ) // strings at the moment
                {
                    Debug.WriteLine(i.Id + " " + i.Type + " " + ASCIIEncoding.ASCII.GetString(i.Value));
                    Debug.WriteLine("");
                }
                else
                {
                    Debug.WriteLine(i.Id + " " + i.Type + " " + i.Value.Length);

                }

            }
            
            // adding a new tag
            // PropertyItem p = new PropertyItem();

            // theImage.SetPropertyItem();
            

Anyway,  we’ll see how this progresses.

Friday, June 20, 2008 4:35:03 PM UTC  #    Comments [0]  | 
Comments are closed.

Theme design by Jelle Druyts

Pick a theme: