Visual Basic .NET Forums  

Go Back   Visual Basic .NET Forums > VB.NET > Graphics/GDI+

Graphics/GDI+ Graphics discussion for VB.NET applications, Winforms, Web, Compact Framework, etc.

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-06-2009, 5:48 PM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Jan 2009
Posts: 3
Reputation: 0
spanner5351 is on a distinguished programming path ahead
Default Help!! GPS in EXIF using VB.NET!!

Hi guys,

only just signed up here because i have been pulling my hair out trying to find answers all of the internet but to no avail!

As part of a project I am writing a program to be able to add GPS information to jpg pictures. For example to add the latitude and longitude to a photo.

So far i have managed to be able to change the latitude and longitude of jpg photos which already have these GPS field in the EXIF.

However...if i try to add the latitude and longitude information to photos that have never been tagged before i get the following error:

"Property cannot be found." on the following lines of code:

Dim latProp As PropertyItem = photo.GetPropertyItem(2)
Dim longProp As PropertyItem = photo.GetPropertyItem(4)


Ok so this to me means, that this photo does not have the above PropertyItems within it EXIF...

my question is....how do i add these PropertyItems to the file!!!???

any ideas!!?

oh and if i havent explained myself clearly, please let me know so i can clarify as i really do need to answers to this.

Thanks!!
-----
Information - Using Visual Studio 2005 and writing in vb.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-16-2009, 8:33 AM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Mar 2009
Age: 22
Posts: 4
Reputation: 0
chahkuehtiao is on a distinguished programming path ahead
Default help me too in GPS exif!

I'm doing the exactly same project.
Can somebody help us?
it's urgent!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-16-2009, 9:34 AM
JohnH's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 36
Posts: 9,163
Reputation: 1079
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

Have a look in help for Image.SetPropertyItem Method, it's kind of weird.
You can also try this CodeProject: The ExifWorks class
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-16-2009, 9:46 AM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Jan 2009
Posts: 3
Reputation: 0
spanner5351 is on a distinguished programming path ahead
Default

image.SetPropertyItem is fine for setting a field which exists. for example if a photo already has GPS data and you want to update it to a new coordinate, that will work.

However, if you try to set this property for a photo that has never had GPS data within it, it will fail and say that this field does not exist.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-16-2009, 10:25 AM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Mar 2009
Age: 22
Posts: 4
Reputation: 0
chahkuehtiao is on a distinguished programming path ahead
Default

Quote:
Originally Posted by spanner5351 View Post
image.SetPropertyItem is fine for setting a field which exists. for example if a photo already has GPS data and you want to update it to a new coordinate, that will work.

However, if you try to set this property for a photo that has never had GPS data within it, it will fail and say that this field does not exist.
That's right , what I want to do is add GPS field within the EXIF.
Pls help me..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-16-2009, 10:29 AM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Jan 2009
Posts: 3
Reputation: 0
spanner5351 is on a distinguished programming path ahead
Default

are you doing this for a school project?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-16-2009, 11:12 AM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Mar 2009
Age: 22
Posts: 4
Reputation: 0
chahkuehtiao is on a distinguished programming path ahead
Default

yup..
but I not good at programming..
headache of it..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-16-2009, 11:22 AM
VB.NET Forum Master
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Nov 2007
Location: UK
Age: 38
Posts: 328
Reputation: 134
InertiaM a shining VB.NET starInertiaM a shining VB.NET starInertiaM a shining VB.NET starInertiaM a shining VB.NET starInertiaM a shining VB.NET starInertiaM a shining VB.NET star
Default

I'll start you off.

Code:
    Private Function CreatePropertyItem() As PropertyItem
        Dim ci As System.Reflection.ConstructorInfo = GetType(PropertyItem).GetConstructor(BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.Public, Nothing, New Type() {}, Nothing)
        Return DirectCast(ci.Invoke(Nothing), PropertyItem)
    End Function
Now you should be able to program or Google the rest
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 03-16-2009, 11:29 AM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Mar 2009
Age: 22
Posts: 4
Reputation: 0
chahkuehtiao is on a distinguished programming path ahead
Default

Quote:
Originally Posted by InertiaM View Post
I'll start you off.

Code:
    Private Function CreatePropertyItem() As PropertyItem
        Dim ci As System.Reflection.ConstructorInfo = GetType(PropertyItem).GetConstructor(BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.Public, Nothing, New Type() {}, Nothing)
        Return DirectCast(ci.Invoke(Nothing), PropertyItem)
    End Function
Now you should be able to program or Google the rest
ok, thanks. I'll try it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
exif, gps, propertyitem


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 8:03 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0


For advertising opportunities click here.