-
-
Notifications
You must be signed in to change notification settings - Fork 777
Closed
Labels
enhancementa request for a new feature or change in behaviora request for a new feature or change in behaviorhelp wantedreleasedThis issue/pull request has been released.This issue/pull request has been released.solution in issue
Description
This library doesn't allow for configuring some decoders that take extra parameters. The line above shows this explicitly where only one argument is given instead of at least another options object. Decoders such as the jpeg-js one offer extra configurations in the form of another configuration that can be useful for a given context (see here google/eleventy-high-performance-blog#10).
My proposal fix would be to change the constructor function to allow an decoderOptions key that map mimetypes to the respective decoder options. For example:
const decoderOptions = {
"image/jpeg": {
maxMemoryUsageInMB: 1024,
}
};
Jimp.decode({ path: "filepath.jpg", decoderOptions, });
Jimp.decode("filepath.jpg", { decoderOptions }); // alternativeReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementa request for a new feature or change in behaviora request for a new feature or change in behaviorhelp wantedreleasedThis issue/pull request has been released.This issue/pull request has been released.solution in issue