unhandled exception error

Dec 5, 2010 at 3:05 PM


Following the latest fix to the application syncing has been working fine, except with 3 folders on my computer (and their equivalent sets on my flickr account).

After going through almost the entire 'normal' syncing sequence, The Flickr Metadata Synchr Activity Log ends with the following error:
Unhandled exception occurred. The application will shut down. Exception details follow:
The line from the Log before the error occurs:
Status 115: 60% - Synchronizing metadata between local and flickr pictures... 

The application shuts down shortly after a Windows7 warning window pops up.

I have tried ticking and unticking some of the options, but without any luck.
I have also tried deleting the set from flickr and then re-uploading the same pictures.  
I can't figure out how to extract the text of the error messages to include in this post, I did take a screenshot of the Activity Log.

No idea what to try next or if this can be easily fixed, but any suggestions would be much appreciated.

Laurens.

Coordinator
Dec 5, 2010 at 8:42 PM

The activity log is also a text file that appears in the same folder as the application. Could you copy some more lines from that?

I've only seen unhandled exceptions occur when metadata is corrupted in local pictures, never due to communication with Flickr. So the problem is probably in one of your local pictures. Hopefully the log file will give more indication about what is going on.

Dec 5, 2010 at 8:55 PM

I did look for the log-file but don't see it in the application directory. 
I'm on W7, with 'show hidden files' turned on... Am I missing a trick?

Coordinator
Dec 5, 2010 at 9:08 PM

Try it with the app running in a folder on your desktop instead of somewhere in program files. Could be a permission thing with the app having problems writing to the log file when you are not running as administrator and the folder requires such permissions to write.

Dec 5, 2010 at 9:17 PM

That seemed to have done the trick!
The error occurs after 1971f04.jpg should I assume that that is the file with the corrupted metadata error?
Do you know a way to fix a corrupted metadata header?

The below was copied from the text-file, but for some reason formatted differently:

FlickrMetadataSynchr.exe Error: 0 : Unhandled exception occurred. The application will shut down. Exception details follow:    DateTime=2010-12-05T22:09:33.5788751ZFlickrMetadataSynchr.exe Error: 0 : System.ArgumentException: The image has corrupted metadata header. ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x88982F63   --- End of inner exception stack trace ---   at System.Windows.Media.ColorContext.GetColorContextsHelper(GetColorContextsDelegate getColorContexts)   at System.Windows.Media.Imaging.BitmapFrameDecode.get_ColorContexts()   at System.Windows.Media.Imaging.BitmapSource.CreateCachedBitmap(BitmapFrame frame, BitmapSourceSafeMILHandle wicSource, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, BitmapPalette palette)   at System.Windows.Media.Imaging.BitmapFrameDecode.FinalizeCreation()   at System.Windows.Media.Imaging.BitmapFrameDecode..ctor(Int32 frameNumber, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, BitmapDecoder decoder)   at System.Windows.Media.Imaging.BitmapDecoder.SetupFrames(BitmapDecoder decoder, ReadOnlyCollection`1 frames)   at System.Windows.Media.Imaging.BitmapDecoder.get_Frames()   at Yorrick.FlickrMetadataSynchr.Local.LocalPicturesHelper.TryUpdatePictureMetadataUsingWicUsingInPlaceMetadataWriter(LocalPictureMetadata metadata) in C:\Sources\FlickrMetadataSynchr\Main\FlickrMetadataSynchr\Local\LocalPicturesHelper.cs:line 792   at Yorrick.FlickrMetadataSynchr.Local.LocalPicturesHelper.UpdatePictureMetadataUsingWic(LocalPictureMetadata metadata) in C:\Sources\FlickrMetadataSynchr\Main\FlickrMetadataSynchr\Local\LocalPicturesHelper.cs:line 744   at Yorrick.FlickrMetadataSynchr.Local.LocalPicturesHelper.<UpdatePictureMetadata>b__0(Object o) in C:\Sources\FlickrMetadataSynchr\Main\FlickrMetadataSynchr\Local\LocalPicturesHelper.cs:line 732   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)   at System.Windows.Threading.DispatcherOperation.InvokeImpl()   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)   at System.Threading.ExecutionContext.runTryCode(Object userData)   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)   at System.Windows.Threading.DispatcherOperation.Invoke()   at System.Windows.Threading.Dispatcher.ProcessQueue()   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)   at System.Windows.Threading.Dispatcher.Run()   at Yorrick.FlickrMetadataSynchr.Local.LocalPicturesHelper.RunWicStaThread(Object arg) in C:\Sources\FlickrMetadataSynchr\Main\FlickrMetadataSynchr\Local\LocalPicturesHelper.cs:line 1033   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)   at System.Threading.ThreadHelper.ThreadStart(Object obj)    DateTime=2010-12-05T22:09:33.5848754Z

Coordinator
Dec 5, 2010 at 9:22 PM

Indeed it says "The image has corrupted metadata header". You can assume that 1971f04.jpg is the trouble maker. Please move it out of the folder and try again.

For the next version I will try to add some error handling around this case which I didn't see before so that the app doesn't crash and instead skips over the picture.

Dec 5, 2010 at 9:33 PM

Thanks very much for your help Erwyn.

The metadata header seems to be corrupted for all images in that folder, I will try re-saving or re-creating it to see if I can set things right.

Coordinator
Dec 6, 2010 at 6:05 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.