PeachImage

PeachImage.Formats.Jxl.JxlJpegReconstruction

JxlJpegReconstruction.ReconstructJpeg Method

Overloads  
ReconstructJpeg(Stream) Reconstructs the original JPEG file from the JPEG XL file in stream.
ReconstructJpeg(Stream, int, TaskScheduler) Reconstructs the original JPEG file from the JPEG XL file in stream, bounding the threads the call may use.
ReconstructJpeg(Stream, Stream) Reconstructs the original JPEG file from the JPEG XL file in source and writes it to destination.
ReconstructJpeg(Stream, Stream, int, TaskScheduler) Reconstructs the original JPEG file from the JPEG XL file in source and writes it to destination, bounding the threads the call may use.

JxlJpegReconstruction.ReconstructJpeg(Stream) Method

Reconstructs the original JPEG file from the JPEG XL file in stream.

public static byte[] ReconstructJpeg(System.IO.Stream stream);

Parameters

stream System.IO.Stream

A readable stream positioned at the start of the file. It is read to its end.

Returns

System.Byte[]
The bytes of the original JPEG file.

Exceptions

JxlUnsupportedFeatureException
The file has no JPEG reconstruction data.

JxlFormatException
The file is not valid JPEG XL, or its reconstruction data is damaged.

JxlJpegReconstruction.ReconstructJpeg(Stream, int, TaskScheduler) Method

Reconstructs the original JPEG file from the JPEG XL file in stream, bounding the threads the call may use.

public static byte[] ReconstructJpeg(System.IO.Stream stream, int maxDegreeOfParallelism, System.Threading.Tasks.TaskScheduler? taskScheduler=null);

Parameters

stream System.IO.Stream

A readable stream positioned at the start of the file. It is read to its end.

maxDegreeOfParallelism System.Int32

The most threads this call may use: -1 leaves it to the library (up to System.Environment.ProcessorCount), 1 runs on the calling thread. Per call, not global. Does not change the output.

taskScheduler System.Threading.Tasks.TaskScheduler

An optional scheduler for the parallel work, to share one limit across concurrent calls. null uses the thread pool.

Returns

System.Byte[]
The bytes of the original JPEG file.

Exceptions

JxlUnsupportedFeatureException
The file has no JPEG reconstruction data.

JxlFormatException
The file is not valid JPEG XL, or its reconstruction data is damaged.

JxlJpegReconstruction.ReconstructJpeg(Stream, Stream) Method

Reconstructs the original JPEG file from the JPEG XL file in source and writes it to destination.

public static void ReconstructJpeg(System.IO.Stream source, System.IO.Stream destination);

Parameters

source System.IO.Stream

destination System.IO.Stream

Exceptions

JxlUnsupportedFeatureException
The file has no JPEG reconstruction data.

JxlFormatException
The file is not valid JPEG XL, or its reconstruction data is damaged.

JxlJpegReconstruction.ReconstructJpeg(Stream, Stream, int, TaskScheduler) Method

Reconstructs the original JPEG file from the JPEG XL file in source and writes it to destination, bounding the threads the call may use.

public static void ReconstructJpeg(System.IO.Stream source, System.IO.Stream destination, int maxDegreeOfParallelism, System.Threading.Tasks.TaskScheduler? taskScheduler=null);

Parameters

source System.IO.Stream

A readable stream positioned at the start of the file. It is read to its end.

destination System.IO.Stream

The stream the result is written to.

maxDegreeOfParallelism System.Int32

The most threads this call may use: -1 leaves it to the library (up to System.Environment.ProcessorCount), 1 runs on the calling thread. Per call, not global. Does not change the output.

taskScheduler System.Threading.Tasks.TaskScheduler

An optional scheduler for the parallel work, to share one limit across concurrent calls. null uses the thread pool.

Exceptions

JxlUnsupportedFeatureException
The file has no JPEG reconstruction data.

JxlFormatException
The file is not valid JPEG XL, or its reconstruction data is damaged.