Click here to Skip to main content
15,895,084 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery1-Jun-09 17:09
Mark Salsbery1-Jun-09 17:09 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread [modified] Pin
Mark Salsbery1-Jun-09 14:13
Mark Salsbery1-Jun-09 14:13 
General[Message Deleted] Pin
fjparisIII1-Jun-09 16:39
fjparisIII1-Jun-09 16:39 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery1-Jun-09 17:06
Mark Salsbery1-Jun-09 17:06 
General[Message Deleted] Pin
fjparisIII1-Jun-09 17:56
fjparisIII1-Jun-09 17:56 
General[Message Deleted] Pin
fjparisIII2-Jun-09 4:40
fjparisIII2-Jun-09 4:40 
General[Message Deleted] Pin
fjparisIII2-Jun-09 5:33
fjparisIII2-Jun-09 5:33 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread [modified] Pin
fjparisIII2-Jun-09 6:24
fjparisIII2-Jun-09 6:24 
Okay, I subscribed to the three events in C# code and ran the app and when it hit the BitmapEncoder.Save() call, my message box produced the following output:

It would probably fail on all images, but the first one it failed on is the following:

C:\temp\ImageScaling\SelectedImages\jpg\001.jpg

Reason: The image data generated an overflow during processing.


This is what I have also been getting with all versions of my code that I have tested with, including my own reimplementation of BackgroundWorker that I tested with yesterday. This time I took a breakpoint where I output this message so I could recover some details about the exception that my message box does not display:

HResult: -2146233066
innerException: {"Overflow or underflow in the arithmetic operation."}
message: The image data generated an overflow during processing.

So the overflow the Exception.Message property is talking about is an arithmetic overflow. So BitmapEncoder.Save() is probably getting an empty buffer or something with all zeroes in it and when it tries to encode the JPEG image data it generates an arithmetic overflow. So the real question is, why doesn't BitmapEncoder.Save() have the actual image data to work with?

I think this conclusively proves that whether BackgroundWorker runs as STA or MTA has nothing to do with my problem, what I expected all along.

modified on Sunday, June 7, 2009 1:15 PM

GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 6:36
Mark Salsbery2-Jun-09 6:36 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread [modified] Pin
fjparisIII2-Jun-09 7:00
fjparisIII2-Jun-09 7:00 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 6:43
Mark Salsbery2-Jun-09 6:43 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 6:45
Mark Salsbery2-Jun-09 6:45 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 6:29
Mark Salsbery2-Jun-09 6:29 
General[Message Deleted] Pin
fjparisIII2-Jun-09 7:52
fjparisIII2-Jun-09 7:52 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 8:07
Mark Salsbery2-Jun-09 8:07 
General[Message Deleted] Pin
fjparisIII2-Jun-09 8:22
fjparisIII2-Jun-09 8:22 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 8:34
Mark Salsbery2-Jun-09 8:34 
General[Message Deleted] Pin
fjparisIII2-Jun-09 9:25
fjparisIII2-Jun-09 9:25 
QuestionRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery2-Jun-09 11:29
Mark Salsbery2-Jun-09 11:29 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII7-Jun-09 7:11
fjparisIII7-Jun-09 7:11 
QuestionWPF TreeViewItem Header Binding Pin
Etienne_12330-May-09 3:34
Etienne_12330-May-09 3:34 
AnswerRe: WPF TreeViewItem Header Binding Pin
Mark Salsbery31-May-09 9:17
Mark Salsbery31-May-09 9:17 
GeneralRe: WPF TreeViewItem Header Binding Pin
Etienne_12331-May-09 19:50
Etienne_12331-May-09 19:50 
GeneralRe: WPF TreeViewItem Header Binding Pin
Mark Salsbery31-May-09 20:36
Mark Salsbery31-May-09 20:36 
QuestionWPF and XML question Pin
Etienne_12330-May-09 1:59
Etienne_12330-May-09 1:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.