PeachImage
PeachImage.Formats.Jxl.JxlJpegReconstruction
JxlJpegReconstruction.TryReconstructJpeg Method
| Overloads | |
|---|---|
| TryReconstructJpeg(Stream, byte[]) | Reconstructs the original JPEG file if the JPEG XL file in stream carries reconstruction data. Returns false (without throwing) for files that are not JPEG XL or were not made from a JPEG. |
| TryReconstructJpeg(Stream, int, TaskScheduler, byte[]) | Like TryReconstructJpeg(Stream, byte[]), bounding the threads the call may use. |
JxlJpegReconstruction.TryReconstructJpeg(Stream, byte[]) Method
Reconstructs the original JPEG file if the JPEG XL file in stream carries reconstruction data. Returns false (without throwing) for files that are not JPEG XL or were not made from a JPEG.
public static bool TryReconstructJpeg(System.IO.Stream stream, out byte[]? jpeg);
Parameters
stream System.IO.Stream
jpeg System.Byte[]
Returns
Exceptions
JxlFormatException
The file claims to hold a JPEG but its data is damaged.
JxlJpegReconstruction.TryReconstructJpeg(Stream, int, TaskScheduler, byte[]) Method
Like TryReconstructJpeg(Stream, byte[]), bounding the threads the call may use.
public static bool TryReconstructJpeg(System.IO.Stream stream, int maxDegreeOfParallelism, System.Threading.Tasks.TaskScheduler? taskScheduler, out byte[]? jpeg);
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.
jpeg System.Byte[]
The original JPEG file, when this returns true.
Returns
Exceptions
JxlFormatException
The file claims to hold a JPEG but its data is damaged.