PeachImage

PeachImage.Formats.Jxl.JxlJpegRecompression

JxlJpegRecompression.TryRecompressJpeg Method

Overloads  
TryRecompressJpeg(Stream, byte[]) Recompresses the JPEG file in stream if it can be recompressed losslessly. Returns false (without throwing) for data that is not a JPEG or uses features that cannot be reproduced.
TryRecompressJpeg(Stream, int, TaskScheduler, byte[]) Like TryRecompressJpeg(Stream, byte[]), bounding the threads the call may use.

JxlJpegRecompression.TryRecompressJpeg(Stream, byte[]) Method

Recompresses the JPEG file in stream if it can be recompressed losslessly. Returns false (without throwing) for data that is not a JPEG or uses features that cannot be reproduced.

public static bool TryRecompressJpeg(System.IO.Stream stream, out byte[]? jxl);

Parameters

stream System.IO.Stream

jxl System.Byte[]

Returns

System.Boolean

JxlJpegRecompression.TryRecompressJpeg(Stream, int, TaskScheduler, byte[]) Method

Like TryRecompressJpeg(Stream, byte[]), bounding the threads the call may use.

public static bool TryRecompressJpeg(System.IO.Stream stream, int maxDegreeOfParallelism, System.Threading.Tasks.TaskScheduler? taskScheduler, out byte[]? jxl);

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.

jxl System.Byte[]

The JPEG XL file, when this returns true.

Returns

System.Boolean