mirror of
https://github.com/lovell/sharp.git
synced 2025-12-06 12:01:41 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3609c61a22 | ||
|
|
dc6820b49f | ||
|
|
f2a49d19c9 |
6
lib/index.d.ts
vendored
6
lib/index.d.ts
vendored
@ -1028,11 +1028,11 @@ declare namespace sharp {
|
|||||||
openSlide?: OpenSlideInputOptions | undefined;
|
openSlide?: OpenSlideInputOptions | undefined;
|
||||||
/** JPEG 2000 specific input options */
|
/** JPEG 2000 specific input options */
|
||||||
jp2?: Jp2InputOptions | undefined;
|
jp2?: Jp2InputOptions | undefined;
|
||||||
/** Deprecated: use tiff.subifd instead */
|
/** @deprecated Use {@link SharpOptions.tiff} instead */
|
||||||
subifd?: number | undefined;
|
subifd?: number | undefined;
|
||||||
/** Deprecated: use pdf.background instead */
|
/** @deprecated Use {@link SharpOptions.pdf} instead */
|
||||||
pdfBackground?: Colour | Color | undefined;
|
pdfBackground?: Colour | Color | undefined;
|
||||||
/** Deprecated: use openSlide.level instead */
|
/** @deprecated Use {@link SharpOptions.openSlide} instead */
|
||||||
level?: number | undefined;
|
level?: number | undefined;
|
||||||
/** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default false) */
|
/** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default false) */
|
||||||
animated?: boolean | undefined;
|
animated?: boolean | undefined;
|
||||||
|
|||||||
@ -120,7 +120,7 @@
|
|||||||
'conditions': [
|
'conditions': [
|
||||||
['use_global_libvips == "true"', {
|
['use_global_libvips == "true"', {
|
||||||
# Use pkg-config for include and lib
|
# Use pkg-config for include and lib
|
||||||
'include_dirs': ['<!@(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --cflags-only-I vips-cpp vips glib-2.0 | sed s\/-I//g)'],
|
'include_dirs': ['<!@(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --cflags-only-I vips-cpp vips glib-2.0 | sed s/-I//g)'],
|
||||||
'libraries': ['<!@(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --libs vips-cpp)'],
|
'libraries': ['<!@(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --libs vips-cpp)'],
|
||||||
'defines': [
|
'defines': [
|
||||||
'SHARP_USE_GLOBAL_LIBVIPS'
|
'SHARP_USE_GLOBAL_LIBVIPS'
|
||||||
|
|||||||
@ -45,11 +45,11 @@ describe('JP2 output', () => {
|
|||||||
assert.strictEqual('png', info.format);
|
assert.strictEqual('png', info.format);
|
||||||
assert.strictEqual(8, info.width);
|
assert.strictEqual(8, info.width);
|
||||||
assert.strictEqual(15, info.height);
|
assert.strictEqual(15, info.height);
|
||||||
assert.strictEqual(4, info.channels);
|
assert.strictEqual(3, info.channels);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('JP2 quality', (done) => {
|
it('JP2 quality', (_t, done) => {
|
||||||
sharp(fixtures.inputJp2)
|
sharp(fixtures.inputJp2)
|
||||||
.resize(320, 240)
|
.resize(320, 240)
|
||||||
.jp2({ quality: 70 })
|
.jp2({ quality: 70 })
|
||||||
@ -65,7 +65,7 @@ describe('JP2 output', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Without chroma subsampling generates larger file', (done) => {
|
it('Without chroma subsampling generates larger file', (_t, done) => {
|
||||||
// First generate with chroma subsampling (default)
|
// First generate with chroma subsampling (default)
|
||||||
sharp(fixtures.inputJp2)
|
sharp(fixtures.inputJp2)
|
||||||
.resize(320, 240)
|
.resize(320, 240)
|
||||||
@ -111,7 +111,7 @@ describe('JP2 output', () => {
|
|||||||
it('Invalid JP2 chromaSubsampling value throws error', () => {
|
it('Invalid JP2 chromaSubsampling value throws error', () => {
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => sharp().jp2({ chromaSubsampling: '4:2:2' }),
|
() => sharp().jp2({ chromaSubsampling: '4:2:2' }),
|
||||||
/Expected one of 4:2:0, 4:4:4 but received 4:2:2 of type string/
|
/Expected one of: 4:2:0, 4:4:4 for chromaSubsampling but received 4:2:2 of type string/
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user