Interpreting Cryptic Jpeg Error Number's By Corbin Dunn
If you have used the TJpegImage class you may be familiar with the "JPEG error #xx" error that comes up on occasion. You may want to know exactly what went wrong, and how to get more information based on that number.
Luckily, the TJpegImage pascal source is included on the Delphi CD. Looking at the source, you will notice that it is a wrapper around some C code. There is one particular file called "jerror.h" which contains an enumeration of error strings. Based on the offset in this enum, you can find out what a given error number means.
For ease of use, I converted the "jerror.h" file to pascal in the unit JpegErrors.pas. To use this unit, simply reference the string array cJpegErrors, passing a given error number to find the error string, such as:
Label .Caption := cJpegErrors ;StrToInt(Edit .Text)]
Note that the JpegErrors.pas unit was based on the Jpeg source that comes with Delphi 5. If the order of the error messages in "jerror.h" ever changes, the JpegErrors.pas will not by in sync with it and has to be updated. Download a sample program and the JpegErrors.pas unit
提供了这个连接,可是我不能下载 :~~~~~~~~~~~~~~<
http://www.delphi32.com/article/images/20433/jpeg_errors.zip