LoadStatus Property (original) (raw)
Summary
Gets a value that allows detection of whether the image was loaded with errors.
Syntax
C#
Objective-C
C++/CLI
Java
Python
@property (nonatomic, assign, readonly) LTError loadStatus
public RasterExceptionCode getLoadStatus()
Property Value
A RasterExceptionCode which indicates the result of the most recent load operation.
The most common return values are:
Value | Meaning |
---|---|
RasterExceptionCode.Success | The image loaded by the last load call does not have any errors. |
RasterExceptionCode.CompressedDataFailure | There were errors decoding the last image. The bottom part of the image might be corrupted. |
RasterExceptionCode.BadResyncMarker | Some of the resync markers were incorrect or missing while decoding the last image. Resync markers are used by JPEG files to recover from decoding errors. Portions of the image are corrupted. They are indicated by a checkerboard pattern. |
RasterExceptionCode.FileRead | The file was truncated. The bottom part of the image is missing. |
Example
This example will load an image and check whether the image has corrupted areas.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
using Leadtools.Svg;
void LoadStatusExample(string fileName)
{
RasterCodecs codecs = new RasterCodecs();
try
{
RasterImage image = codecs.Load(fileName, 0, CodecsLoadByteOrder.Bgr, 1, 1);
RasterExceptionCode loadStatusCode = codecs.LoadStatus;
if (loadStatusCode == RasterExceptionCode.Success)
Debug.WriteLine("The image was loaded successfully and with no errors");
else
Debug.WriteLine("The image was loaded, but it might have corrupted areas, error = {0}", loadStatusCode);
image.Dispose();
}
catch (RasterException ex)
{
Debug.WriteLine("LEADTOOLS could not load this image, error code is is '{0}', message is '{1}'", ex.Code, ex.Message);
}
// Clean up
codecs.Dispose();
}
Leadtools.Codecs Assembly
CompactFile(Stream,Stream,int,int,bool,int,int,bool,int,CodecsSavePageMode,bool,bool) Method
CompactFile(Stream,Stream,int,int,bool,long,int,bool,long,CodecsSavePageMode,bool,bool,bool) Method
CompactFile(string,string,int,int,bool,int,int,bool,int,CodecsSavePageMode,bool,bool) Method
CompactFile(string,string,int,int,bool,long,int,bool,long,CodecsSavePageMode,bool,bool,bool) Method