Optional
options: SharpOptionsObject with optional attributes.
A sharp instance that can be used to chain operations
Invalid parameters
Optional
input: string | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array | Buffer | ArrayBufferOptional
options: SharpOptionsObject containing nested boolean values representing the available input and output formats/methods.
#endregion
An Object containing the available interpolators and their proper values
An EventEmitter that emits a change event when a task is either queued, waiting for libuv to provide a worker thread, complete
An Object containing the version numbers of sharp, libvips and its dependencies.
Optional
avif?: stringOptional
cairo?: stringOptional
croco?: stringOptional
exif?: stringOptional
expat?: stringOptional
ffi?: stringOptional
fontconfig?: stringOptional
freetype?: stringOptional
gdkpixbuf?: stringOptional
gif?: stringOptional
glib?: stringOptional
gsf?: stringOptional
harfbuzz?: stringOptional
heif?: stringOptional
jpeg?: stringOptional
lcms?: stringOptional
orc?: stringOptional
pango?: stringOptional
pixman?: stringOptional
png?: stringOptional
sharp?: stringOptional
svg?: stringOptional
tiff?: stringOptional
webp?: stringOptional
xml?: stringOptional
zlib?: stringBlock libvips operations at runtime.
This is in addition to the VIPS_BLOCK_UNTRUSTED
environment variable,
which when set will block all "untrusted" operations.
List of libvips low-level operation names to block.
0.32.4
sharp.block({
operation: ['VipsForeignLoadTiff']
});
Gets or, when options are provided, sets the limits of libvips' operation cache. Existing entries in the cache will be trimmed after any change in limits. This method always returns cache statistics, useful for determining how much working memory is required for a particular task.
Optional
options: boolean | CacheOptionsObject with the following attributes, or Boolean where true uses default cache settings and false removes all caching (optional, default true)
The cache results.
Gets or sets the number of threads libvips' should create to process each image. The default value is the number of CPU cores. A value of 0 will reset to this default. The maximum number of images that can be processed in parallel is limited by libuv's UV_THREADPOOL_SIZE environment variable.
Optional
concurrency: numberThe new concurrency value.
The current concurrency value.
Get and set use of SIMD vector unit instructions. Requires libvips to have been compiled with highway support. Improves the performance of resize, blur and sharpen operations by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM NEON.
Optional
enable: booleanenable or disable use of SIMD vector unit instructions
true if usage of SIMD vector unit instructions is enabled
Unblock libvips operations at runtime.
This is useful for defining a list of allowed operations.
List of libvips low-level operation names to unblock.
0.32.4
sharp.block({
operation: ['VipsForeignLoad']
});
sharp.unblock({
operation: ['VipsForeignLoadWebpFile']
});
sharp.block({
operation: ['VipsForeignLoad']
});
sharp.unblock({
operation: ['VipsForeignLoadJpegBuffer', 'VipsForeignLoadPngBuffer']
});
Generated using TypeDoc
Creates a sharp instance from an image