Board index » cppbuilder » How to handle "JPEG error #67"
mori
![]() CBuilder Developer |
Sat, 05 Nov 2005 14:27:15 GMT
|
mori
![]() CBuilder Developer |
Sat, 05 Nov 2005 14:27:15 GMT
How to handle "JPEG error #67"
Hi,
I wrote a program to show image(use TImage->Picture->Assign(jpg) to assign one JPEG image) form one web camera. Sometimes, the program will prompt "JPEG error #67". I try to use try {} catch(...){} to catch this message, but the program still throwed this message out. How can I catch this error message so that I can do some actions in this situation? Can anyone help me. Thanks Mori. |
Hans Galem
![]() CBuilder Developer |
Sat, 05 Nov 2005 22:39:08 GMT
Re:How to handle "JPEG error #67"Quotemori wrote: Could you show the complete code loading this image from file/stream ? You could post two jpg's in the attachment newsgroup. Hans. |
Maynard Philbroo
![]() CBuilder Developer |
Sun, 06 Nov 2005 01:19:37 GMT
Re:How to handle "JPEG error #67"when you do your "catch" make sure you do not specify a particuler exception. just use a generic catch all type. Quotemori wrote: |
Maynard Philbroo
![]() CBuilder Developer |
Sun, 06 Nov 2005 01:19:56 GMT
Re:How to handle "JPEG error #67"P.S. also do this out side of the IDE.. Quotemori wrote: |
mori
![]() CBuilder Developer |
Sun, 06 Nov 2005 10:34:34 GMT
Re:How to handle "JPEG error #67"hi, The following are my codes: TImage *Image; TJPEGImage *jpg; jpg = new TJPEGImage; jpg->LoadFromStream(ms); // ms is the memory buffer stored my image from web camera. Image->Picture->Assign(jpg); // run at this line will course error I have found out the meaning of this error message. It's caused by the "Hans Galema" <j.m.galema.dontuset...@maartens.nl> ???g??ls?D Quote> mori wrote: |
Hans Galem
![]() CBuilder Developer |
Sun, 06 Nov 2005 14:27:21 GMT
Re:How to handle "JPEG error #67"Quotemori wrote: Try to find out why the image is incomplete. To few bytes ? A header error ? Look at TJPEGImage Width and Height or at TStream Size. You can still write the stream to files and post them in attachments. Hans. |
Hans Galem
![]() CBuilder Developer |
Sun, 06 Nov 2005 14:34:19 GMT
Re:How to handle "JPEG error #67"Quotemori wrote: Quote> Image->Picture->Assign(jpg); // run at this line will course error Are you sure the error comes from Image->Picture->Assign(jpg) Where is the 'delete jpg;' ? How do you position the stream to 0 ? Hans. |
mori
![]() CBuilder Developer |
Mon, 07 Nov 2005 16:53:53 GMT
Re:How to handle "JPEG error #67"Hi, Sorry for poor information The try and catch didn't trap the error message, so I removed it. The code is as below TImage *Image; // VCL component and declare in the mainform.h void ShowImage(TMemoryStream *ms) Quote} Besides, the try and catch didn't work, so that I can't save this memory buffer to a file. I run the program in debuging mode and the program stop at " Image->Picture->Assign(jpg);" so that I guess that executing this line will cause the error message. Is it correct? Thanks "Hans Galema" <j.m.galema.dontuset...@maartens.nl> ???g??ls?D Quote> mori wrote: |
Hans Galem
![]() CBuilder Developer |
Mon, 07 Nov 2005 18:22:20 GMT
Re:How to handle "JPEG error #67"Quotemori wrote: Of course you can. You can add somes lines that save every image to disk static int times = 0; AnsiString FileName = "{*word*272}." + IntToStr ( ++times ) + ".jpg"; jpg->SaveToFile ( FileName ); Quote> Besides, the try and catch didn't work, so that I can't save this memory Quote> I run the program in debuging mode and the program stop at " try your program. First, place a message in your catch statement. Wich excption do you handle ? Third, make a testrun where you do NOT assign the ms to the You did not react on another post to investigate Width, Heigth and Hans. |
1. How to Trap a JPEG #67 (incomplete JPEG) error
3. "Error Creating Cursor Handle"
4. "Error creating cursor handle"
5. "Error Creating Cursor Handle"
6. "Error Creating Cursor Handle"
7. "Invalid Blob handle in record buffer"-error PLEASE HELP
8. StoredProc: "Error creating cursor handle"