Show / Hide Table of Contents

Class jpeg_error_mgr

Contains simple error-reporting and trace-message routines.

Inheritance
System.Object
jpeg_error_mgr
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: BitMiracle.LibJpeg.Classic
Assembly: BitMiracle.LibJpeg.NET.dll
Syntax
public class jpeg_error_mgr
Remarks

This class is used by both the compression and decompression code.

Constructors

| Improve this Doc View Source

jpeg_error_mgr()

Initializes a new instance of the jpeg_error_mgr class.

Declaration
public jpeg_error_mgr()

Properties

| Improve this Doc View Source

Num_warnings

Gets the number of corrupt-data warnings.

Declaration
public int Num_warnings { get; }
Property Value
Type Description
System.Int32

The num_warnings.

Remarks

For recoverable corrupt-data errors, we emit a warning message, but keep going unless emit_message(Int32) chooses to abort. emit_message should count warnings in Num_warnings. The surrounding application can check for bad data by seeing if Num_warnings is nonzero at the end of processing.

| Improve this Doc View Source

Trace_level

Gets or sets the maximum message level that will be displayed.

Declaration
public int Trace_level { get; set; }
Property Value
Type Description
System.Int32

Values are: -1: recoverable corrupt-data warning, may want to abort.
0: important advisory messages (always display to user).
1: first level of tracing detail.
2, 3, ...: successively more detailed tracing messages.

See Also
emit_message(Int32)

Methods

| Improve this Doc View Source

emit_message(Int32)

Conditionally emit a trace or warning message.

Declaration
public virtual void emit_message(int msg_level)
Parameters
Type Name Description
System.Int32 msg_level

The message severity level.
Values are:
-1: recoverable corrupt-data warning, may want to abort.
0: important advisory messages (always display to user).
1: first level of tracing detail.
2, 3, ...: successively more detailed tracing messages.

Remarks

The main reason for overriding this method would be to abort on warnings. This method calls output_message() for message showing.

An application might override this method if it wanted to abort on warnings or change the policy about which messages to display.

See Also
Error handling
| Improve this Doc View Source

error_exit()

Receives control for a fatal error.

Declaration
public virtual void error_exit()
Remarks

This method calls output_message() and then throws an exception.

See Also
Error handling
| Improve this Doc View Source

format_message()

Constructs a readable error message string.

Declaration
public virtual string format_message()
Returns
Type Description
System.String

The formatted message

Remarks

This method is called by output_message(). Few applications should need to override this method. One possible reason for doing so is to implement dynamic switching of error message language.

See Also
Error handling
| Improve this Doc View Source

GetMessageText(Int32)

Gets the actual message texts.

Declaration
protected virtual string GetMessageText(int code)
Parameters
Type Name Description
System.Int32 code

The message code. See J_MESSAGE_CODE for details.

Returns
Type Description
System.String

The message text associated with code.

Remarks

It may be useful for an application to add its own message texts that are handled by the same mechanism. You can override GetMessageText for this purpose. If you number the addon messages beginning at 1000 or so, you won't have to worry about conflicts with the library's built-in messages.

See Also
J_MESSAGE_CODE
Error handling
| Improve this Doc View Source

output_message()

Actual output of any JPEG message.

Declaration
public virtual void output_message()
Remarks

Override this to send messages somewhere other than Console. Note that this method does not know how to generate a message, only where to send it. For extending a generation of messages see format_message().

See Also
Error handling
| Improve this Doc View Source

reset_error_mgr()

Resets error manager to initial state.

Declaration
public virtual void reset_error_mgr()
Remarks

This is called during compression startup to reset trace/error processing to default state. An application might possibly want to override this method if it has additional error processing state.

See Also

Error handling
  • Improve this Doc
  • View Source
Back to top Generated by DocFX