473,569 Members | 3,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing EXIF file properties

Hi, I have this code which it should change the EXIF file properties of
images, but there is something that doesn't work, any ideas???

Private Sub ShowBitMapProp( ByVal sFile As String)

Dim sExt = LCase(sFile).Su bstring(sFile.L astIndexOf(".") )

If sExt = ".jpg" Or sExt = ".gif" Then

Response.Write( "ShowBitMapProp <br>" & vbCrLf)

Dim oBitmap As Image = Image.FromFile( sFile)

'Dim oProba As Image = Image.FromFile( sFile)

'oProba.Dispose ()

'oBitmap = oProba.Clone

'Dim oBitmap As Bitmap = New Bitmap(sFile)

'Dim ooBitmap As Birmap = oBitmap.FromFil e(sFile)

Dim iConta As Integer

Response.Write( "Number of properties: " &
oBitmap.Propert yItems.Length.T oString & "<br>" & vbCrLf)

Dim oPrps() As System.Drawing. Imaging.Propert yItem

Dim oPrp As System.Drawing. Imaging.Propert yItem

oPrps = oBitmap.Propert yItems

Dim bByte() As Byte

Dim bConv As System.BitConve rter

Dim utf As New System.Text.UTF 7Encoding

Dim bNewValue() As Byte

Dim iCont As Integer

Dim sProba As String = "Joaquin"

For iConta = 0 To oPrps.Length

oPrp = oPrps(iConta)

'Response.Write (oBitmap.Proper tyIdList.GetVal ue(iConta).ToSt ring & " Idlist
" & iConta & "<br>" & vbCrLf)

If oPrp.Id.ToStrin g = "40091" Or oPrp.Id.ToStrin g = "40092" Or _

oPrp.Id.ToStrin g = "40093" Or oPrp.Id.ToStrin g = "40094" Or _

oPrp.Id.ToStrin g = "40095" Then

Response.Write( oPrp.Id & "<br>")

bByte = oPrp.Value

Try

Response.Write( "Old Value: " & utf.GetString(b Byte) & "; ")

bNewValue = utf.GetBytes(ut f.GetString(bBy te))

bNewValue = utf.GetBytes("J oaquin")

oPrp.Id = oPrp.Id

oPrp.Type = oPrp.Type

oPrp.Len = System.Text.ASC IIEncoding.Unic ode.GetBytes(sP roba).Length

oPrp.Value = System.Text.ASC IIEncoding.Unic ode.GetBytes(sP roba)

oBitmap.SetProp ertyItem(oPrp)

Catch

Response.Write( Err.Description & " Error<br>")

End Try

End If

'40091: Title

'40092: Comments

'40093: Author

'40094: Keywords

'40095: Subject

Next

Try

'File.Delete(sF ile)

oBitmap.Save(sF ile)

Catch

Response.Write( Err.Description & " Error 2 <br>")

End Try

End If

End Sub

Thank you for your help
Nov 19 '05 #1
0 1450

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9401
by: Jan Schmidt | last post by:
Hi NG, i created my own Picture Gallery, which reads the EXIF Data of each Picture before displaying on website. I'd like to give my users the ability to alter some opened EXIF Values. It would reduce the Traffic, because users don't need to upload the whole Picture because of an missing, or bad Value of EXIF Data. But i still can't find...
0
1890
by: leo | last post by:
hi there i'm using gene cash's EXIF.py module to find out the shoting time of an jpeg image. this module works usually like a beauty, but some images raise an exception: Traceback (most recent call last): File "/Users/Shared/bin/exiftool.py", line 148, in ? tags=EXIF.process_file(f)
2
3452
by: Roel Schroeven | last post by:
Hi, I'm looking into processing images with EXIF data. I've been looking around and I've found a number of Python modules that read EXIF data, but I did not find a module for writing EXIF data. Does anybody know of such a beast? -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac...
5
4720
by: TheGanjaMan | last post by:
Hi everyone, I'm trying to write up a simple image stamper application that stamps the Exif date information from the jpegs that I've taken from my digital camera and saves the new file with the date stamped on the lower right part of the picture. (I'm not an advanced programmer so my code may not be 100% efficient - sorry, I'm still...
1
4938
by: Alfonso Acosta | last post by:
Hi all, exif_read_data() doesn't support URLs (http://php.net/manual/en/function.exif-read-data.php ) but I would like to do that with the minimum traffic and overhead possible. A naive solution would be downloading the whole target file locally and then call exif_read_data() but that means a lot of overhead traffic
14
5207
by: Frank | last post by:
I see that ImageFormat includes exif. But I can't find out if I've System.Drawing.Image.FromStream or something like it can read and/or write that format.
1
2604
by: gdgass | last post by:
Hi, I'm in the process of developing an app to scan and archive photos based upon the EXIF/Photo Keyword property. One of the requirements is that the Photo's keywords be editable via Digital Image Suite 2006 Library . Then the app will look for a specific keyword, change the keyword to indicate the photo has been scanned and move a copy...
5
2098
by: David Veeneman | last post by:
I'm opening a JPG file to read and write its EXIF properties. I'm using very simple code to open the file: myBitmap = new Bitmap(filePath); Reading and writing the properties is working fine, but when I go to save the file, I'm getting an exception that reads "A generic error occurred in GDI+." Here's the code I'm using to save the file...
8
5863
by: infoseekar | last post by:
Does anyone know what's the right code to read IPTC metadata. I have the code to read EXIF metadata and it gives me alot of information which I don't need. How do I modify this code so it only give the information i required. EXIF inout code <?php $path="image.jpeg";
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.