This module provides a full-featured IIIF Image API 2.1 and 3.0 image processor. It covers only the image processing pipeline itself, leaving input and output to the caller.
Apache License 2.0
27
stars
5
forks
source link
Add density option; improve tests & documentation #18
This PR has three distinct commits in order to make review easier, but they should be squashed on commit.
The new feature is the addition of a density option to the constructor, which tells the processor to assert a given pixel density (in pixels per inch) in the output image. This has absolutely no effect on the size or quality of the image; it's simply a convenience so that images show up at a reasonable size when imported into Photoshop, Illustrator, or InDesign.
In adding this option, I also refactored the new Processor() constructor so that it can take two different forms:
The old way (for backward compatibility; will give a deprecation warning):
new Processor(url, streamResolver, [dimensionFunction], [maxWidth], [includeMetadata])
The new way (using an options object for optional values):
new Processor(url, streamResolver, { maxWidth: 1024, density: 600 })
Additional changes:
Bump version to 1.0.0 because of the constructor interface change
Add 40 additional tests, bringing coverage from 57% to nearly 100%
Improve documentation
Remove .gif as a target format, because it turns out VIPS doesn't support it natively and it never actually worked
This PR has three distinct commits in order to make review easier, but they should be squashed on commit.
The new feature is the addition of a
density
option to the constructor, which tells the processor to assert a given pixel density (in pixels per inch) in the output image. This has absolutely no effect on the size or quality of the image; it's simply a convenience so that images show up at a reasonable size when imported into Photoshop, Illustrator, or InDesign.In adding this option, I also refactored the
new Processor()
constructor so that it can take two different forms:The old way (for backward compatibility; will give a deprecation warning):
The new way (using an options object for optional values):
Additional changes:
1.0.0
because of the constructor interface change.gif
as a target format, because it turns out VIPS doesn't support it natively and it never actually worked