Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
ChingYen  
#1 Posted : Tuesday, June 24, 2008 12:27:49 PM(UTC)
ChingYen

Rank: Advanced Member

Groups: Member
Joined: 3/3/2008(UTC)
Posts: 185

Thanks: 8 times
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.

Edited by user Tuesday, June 24, 2008 8:50:31 PM(UTC)  | Reason: Not specified

Dmitry  
#2 Posted : Tuesday, June 24, 2008 8:48:44 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

Could you attach the image file causing the problem?

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

ChingYen  
#3 Posted : Tuesday, June 24, 2008 10:59:46 PM(UTC)
ChingYen

Rank: Advanced Member

Groups: Member
Joined: 3/3/2008(UTC)
Posts: 185

Thanks: 8 times
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

ChingYen attached the following image(s):
Output.jpg
Alex Kon  
#4 Posted : Wednesday, June 25, 2008 2:52:01 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Member
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hello,

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

Edited by user Wednesday, June 25, 2008 2:53:24 PM(UTC)  | Reason: Not specified

ChingYen  
#5 Posted : Wednesday, June 25, 2008 6:51:28 PM(UTC)
ChingYen

Rank: Advanced Member

Groups: Member
Joined: 3/3/2008(UTC)
Posts: 185

Thanks: 8 times
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.