![]() |
Click here to advertise with us
|
|
|||||||
| Graphics/GDI+ Graphics discussion for VB.NET applications, Winforms, Web, Compact Framework, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 |
|
||||
|
Have a look in help for Image.SetPropertyItem Method, it's kind of weird.
You can also try this CodeProject: The ExifWorks class
__________________
Some useful links: Learning videoes, Code Samples, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ
How to format posts with code blocks etc - present the problem/post properly ![]() |
|
|||
|
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. |
|
|||
|
Quote:
Pls help me.. |
|
|||
|
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
|
|
|||
|
Quote:
|
![]() |
| Bookmarks |
| Tags |
| exif, gps, propertyitem |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|