Welcome Guest Search | Active Topics | Members

tmpDateString = exifData.Item(ExifDictionary.DateTimeOriginal) Options
ChingYen
Posted: Tuesday, June 24, 2008 8:27:49 PM
Rank: Advanced Member
Groups: Member

Joined: 3/3/2008
Posts: 47
Points: 141
I just try to upgrade the component from 4.5 to 5.0.

I found that i gave error on this line of code
tmpDateString = exifData.Item(Aurigma.GraphicsMill.Codecs.ExifDictionary.DateTimeOriginal)

The error as below:
Run-time exception thrown : System.ArgumentException - The value with the specified key does not exist in collection.
Parameter name: key


The code was working fine under 4.5

Please advice.
Dmitry
Posted: Wednesday, June 25, 2008 4:48:44 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 586
Points: 588
Hello,

Could you attach the image file causing the problem?

Sincerely yours,
Dmitry Sevostyanov.
ChingYen
Posted: Wednesday, June 25, 2008 6:59:46 AM
Rank: Advanced Member
Groups: Member

Joined: 3/3/2008
Posts: 47
Points: 141
Code:
18:                 Dim formatReader As Codecs.IFormatReader
19:                 formatReader = Codecs.FormatManager.CreateFormatReader(strFileName)
20:                 Dim exifData As Codecs.MetadataDictionary

21:                 Select Case formatReader.MediaFormat
                        Case Codecs.FormatManager.JpegFormat
22:                         Dim jpegReader As Codecs.JpegReader
23:                         jpegReader = CType(formatReader, Codecs.JpegReader)
24:                         exifData = jpegReader.Exif

25:                     Case Codecs.FormatManager.PsdFormat
26:                         Dim psdReader As Codecs.PsdReader
27:                         psdReader = CType(formatReader, Codecs.PsdReader)
28:                         exifData = psdReader.Exif

29:                     Case Codecs.FormatManager.TiffFormat
30:                         Dim tiffReader As Codecs.TiffReader
31:                         tiffReader = CType(formatReader, Codecs.TiffReader)
32:                         exifData = tiffReader.Exif
33:                     Case Else
34:                         Exit Function
35:                         End Select

36:                 Dim tmpDateString As String = ""
37:                 Try
                        tmpDateString = _
                        Format(exifData.Item(Aurigma.GraphicsMill.Codecs.ExifDictionary.DateTimeOriginal), yyyy-mm-dd HH:mm:ss") <- this is where give error
                        '
39:                 Catch ex As Exception
                        tmpDateString = "1601-01-01 00:00:01"
40:                 End Try


File Attachment(s):
Output.jpg (1,431kb) downloaded 1 time(s).


Alex Kon
Posted: Wednesday, June 25, 2008 10:52:01 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 386
Points: 403
Hello,

The file you sent doesn't contain such EXIF tag. You should add additional check before using this value using Contains(...) method.


Best wishes, Alex.
ChingYen
Posted: Thursday, June 26, 2008 2:51:28 AM
Rank: Advanced Member
Groups: Member

Joined: 3/3/2008
Posts: 47
Points: 141
Thanks !!!
Users browsing this topic
Guest


Forum Jump
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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.