Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sharp

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sharp - npm Package Compare versions

Comparing version 0.32.0 to 0.32.1

29

install/libvips.js

@@ -14,2 +14,3 @@ // Copyright 2013 Lovell Fuller and others.

const detectLibc = require('detect-libc');
const semverCoerce = require('semver/functions/coerce');
const semverLessThan = require('semver/functions/lt');

@@ -81,3 +82,7 @@ const semverSatisfies = require('semver/functions/satisfies');

if (expected !== digest) {
libvips.removeVendoredLibvips();
try {
libvips.removeVendoredLibvips();
} catch (err) {
libvips.log(err.message);
}
libvips.log(`Integrity expected: ${expected}`);

@@ -140,13 +145,15 @@ libvips.log(`Integrity received: ${digest}`);

// Linux libc version check
const libcFamily = detectLibc.familySync();
const libcVersion = detectLibc.versionSync();
if (libcFamily === detectLibc.GLIBC && libcVersion && minimumGlibcVersionByArch[arch]) {
const libcVersionWithoutPatch = libcVersion.split('.').slice(0, 2).join('.');
if (semverLessThan(`${libcVersionWithoutPatch}.0`, `${minimumGlibcVersionByArch[arch]}.0`)) {
handleError(new Error(`Use with glibc ${libcVersion} requires manual installation of libvips >= ${minimumLibvipsVersion}`));
const libcVersionRaw = detectLibc.versionSync();
if (libcVersionRaw) {
const libcFamily = detectLibc.familySync();
const libcVersion = semverCoerce(libcVersionRaw).version;
if (libcFamily === detectLibc.GLIBC && minimumGlibcVersionByArch[arch]) {
if (semverLessThan(libcVersion, semverCoerce(minimumGlibcVersionByArch[arch]).version)) {
handleError(new Error(`Use with glibc ${libcVersionRaw} requires manual installation of libvips >= ${minimumLibvipsVersion}`));
}
}
}
if (libcFamily === detectLibc.MUSL && libcVersion) {
if (semverLessThan(libcVersion, '1.1.24')) {
handleError(new Error(`Use with musl ${libcVersion} requires manual installation of libvips >= ${minimumLibvipsVersion}`));
if (libcFamily === detectLibc.MUSL) {
if (semverLessThan(libcVersion, '1.1.24')) {
handleError(new Error(`Use with musl ${libcVersionRaw} requires manual installation of libvips >= ${minimumLibvipsVersion}`));
}
}

@@ -153,0 +160,0 @@ }

@@ -33,3 +33,3 @@ // Copyright 2013 Lovell Fuller and others.

: null;
log(`Via proxy ${proxy.protocol}://${proxy.hostname}:${proxy.port} ${proxyAuth ? 'with' : 'no'} credentials`);
log(`Via proxy ${proxy.protocol}//${proxy.hostname}:${proxy.port} ${proxyAuth ? 'with' : 'no'} credentials`);
return tunnel({

@@ -36,0 +36,0 @@ proxy: {

@@ -73,3 +73,4 @@ // Copyright 2013 Lovell Fuller and others.

* The input image will be converted to the provided colourspace at the start of the pipeline.
* All operations will use this colourspace before converting to the output colourspace, as defined by {@link toColourspace}.
* All operations will use this colourspace before converting to the output colourspace,
* as defined by {@link #tocolourspace|toColourspace}.
*

@@ -76,0 +77,0 @@ * This feature is experimental and has not yet been fully-tested with all operations.

@@ -157,5 +157,5 @@ // Copyright 2013 Lovell Fuller and others.

* @param {string} [options.text.fontfile] - absolute filesystem path to a font file that can be used by `font`.
* @param {number} [options.text.width=0] - integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries.
* @param {number} [options.text.height=0] - integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0.
* @param {string} [options.text.align='left'] - text alignment (`'left'`, `'centre'`, `'center'`, `'right'`).
* @param {number} [options.text.width=0] - Integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries.
* @param {number} [options.text.height=0] - Maximum integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0.
* @param {string} [options.text.align='left'] - Alignment style for multi-line text (`'left'`, `'centre'`, `'center'`, `'right'`).
* @param {boolean} [options.text.justify=false] - set this to true to apply justification to the text.

@@ -221,2 +221,3 @@ * @param {number} [options.text.dpi=72] - the resolution (size) at which to render the text. Does not take effect if `height` is specified.

flattenBackground: [0, 0, 0],
unflatten: false,
negate: false,

@@ -223,0 +224,0 @@ negateAlpha: true,

@@ -91,4 +91,3 @@ // Copyright 2013 Lovell Fuller and others.

const removeVendoredLibvips = function () {
const rm = fs.rmSync ? fs.rmSync : fs.rmdirSync;
rm(vendorPath, { recursive: true, maxRetries: 3, force: true });
fs.rmSync(vendorPath, { recursive: true, maxRetries: 3, force: true });
};

@@ -95,0 +94,0 @@

@@ -117,3 +117,3 @@ // Copyright 2013 Lovell Fuller and others.

* By default, new pixels are filled with a black background. You can provide a background color with the `background` option.
* A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolator` Object e.g. `sharp.interpolator.nohalo`.
* A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolators` Object e.g. `sharp.interpolators.nohalo`.
*

@@ -135,3 +135,3 @@ * In the case of a 2x2 matrix, the transform is:

* background: 'white',
* interpolate: sharp.interpolators.nohalo
* interpolator: sharp.interpolators.nohalo
* })

@@ -411,2 +411,28 @@ * .toBuffer((err, outputBuffer, info) => {

/**
* Ensure the image has an alpha channel
* with all white pixel values made fully transparent.
*
* Existing alpha channel values for non-white pixels remain unchanged.
*
* This feature is experimental and the API may change.
*
* @since 0.32.1
*
* @example
* await sharp(rgbInput)
* .unflatten()
* .toBuffer();
*
* @example
* await sharp(rgbInput)
* .threshold(128, { grayscale: false }) // converter bright pixels to white
* .unflatten()
* .toBuffer();
*/
function unflatten () {
this.options.unflatten = true;
return this;
}
/**
* Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of `1/gamma`

@@ -881,2 +907,3 @@ * then increasing the encoding (brighten) post-resize at a factor of `gamma`.

flatten,
unflatten,
gamma,

@@ -883,0 +910,0 @@ negate,

@@ -46,3 +46,3 @@ // Copyright 2013 Lovell Fuller and others.

* By default all metadata will be removed, which includes EXIF-based orientation.
* See {@link withMetadata} for control over this.
* See {@link #withmetadata|withMetadata} for control over this.
*

@@ -99,3 +99,3 @@ * The caller is responsible for ensuring directory structures and permissions exist.

*
* Use {@link toFormat} or one of the format-specific functions such as {@link jpeg}, {@link png} etc. to set the output format.
* Use {@link #toformat|toFormat} or one of the format-specific functions such as {@link jpeg}, {@link png} etc. to set the output format.
*

@@ -105,3 +105,3 @@ * If no explicit format is set, the output format will match the input image, except SVG input which becomes PNG output.

* By default all metadata will be removed, which includes EXIF-based orientation.
* See {@link withMetadata} for control over this.
* See {@link #withmetadata|withMetadata} for control over this.
*

@@ -183,3 +183,3 @@ * `callback`, if present, gets three arguments `(err, data, info)` where:

* @example
* // Set "IFD0-Copyright" in output EXIF metadata
* // Set output EXIF metadata
* const data = await sharp(input)

@@ -189,3 +189,9 @@ * .withMetadata({

* IFD0: {
* Copyright: 'Wernham Hogg'
* Copyright: 'The National Gallery'
* },
* IFD3: {
* GPSLatitudeRef: 'N',
* GPSLatitude: '51/1 30/1 3230/100',
* GPSLongitudeRef: 'W',
* GPSLongitude: '0/1 7/1 4366/100'
* }

@@ -634,2 +640,3 @@ * }

/* istanbul ignore next */
/**

@@ -668,3 +675,2 @@ * Use these JP2 options for output image.

*/
/* istanbul ignore next */
function jp2 (options) {

@@ -750,3 +756,4 @@ if (!this.constructor.format.jp2k.output.buffer) {

*
* The `density` can be set in pixels/inch via {@link withMetadata} instead of providing `xres` and `yres` in pixels/mm.
* The `density` can be set in pixels/inch via {@link #withmetadata|withMetadata}
* instead of providing `xres` and `yres` in pixels/mm.
*

@@ -753,0 +760,0 @@ * @example

{
"name": "sharp",
"description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",
"version": "0.32.0",
"version": "0.32.1",
"author": "Lovell Fuller <npm@lovell.info>",

@@ -137,5 +137,5 @@ "homepage": "https://github.com/lovell/sharp",

"detect-libc": "^2.0.1",
"node-addon-api": "^6.0.0",
"node-addon-api": "^6.1.0",
"prebuild-install": "^7.1.1",
"semver": "^7.3.8",
"semver": "^7.5.0",
"simple-get": "^4.0.1",

@@ -151,3 +151,3 @@ "tar-fs": "^2.1.1",

"extract-zip": "^2.0.1",
"icc": "^2.0.0",
"icc": "^3.0.0",
"jsdoc-to-markdown": "^8.0.0",

@@ -160,3 +160,3 @@ "license-checker": "^25.0.1",

"semistandard": "^16.0.1",
"tsd": "^0.28.0"
"tsd": "^0.28.1"
},

@@ -163,0 +163,0 @@ "license": "Apache-2.0",

@@ -101,4 +101,2 @@ # sharp

[![Node-API v5](https://img.shields.io/badge/Node--API-v5-green.svg)](https://nodejs.org/dist/latest/docs/api/n-api.html#n_api_n_api_version_matrix)
## Licensing

@@ -105,0 +103,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc