mirror of
https://github.com/lovell/sharp.git
synced 2026-02-05 22:26:20 +01:00
Compare commits
9 Commits
v0.33.0-al
...
v0.33.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6377d5a73a | ||
|
|
80e4707af1 | ||
|
|
ab00e34d0d | ||
|
|
7c2f883b67 | ||
|
|
9b5eecba8f | ||
|
|
4b028edfe9 | ||
|
|
7e25dd7be1 | ||
|
|
09460d7af4 | ||
|
|
3b22640077 |
30
.github/workflows/npm.yml
vendored
30
.github/workflows/npm.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: "npm release smoke test"
|
name: "CI: npm smoke test"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -26,6 +26,10 @@ jobs:
|
|||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v2
|
||||||
|
with:
|
||||||
|
version: 8
|
||||||
- name: Install Deno
|
- name: Install Deno
|
||||||
uses: denoland/setup-deno@v1
|
uses: denoland/setup-deno@v1
|
||||||
with:
|
with:
|
||||||
@@ -43,7 +47,7 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
core.setOutput('semver', context.ref.replace('refs/tags/v',''))
|
core.setOutput('semver', context.ref.replace('refs/tags/v',''))
|
||||||
- name: Create package.json
|
- name: Create package.json
|
||||||
uses: DamianReeves/write-file-action@v1
|
uses: DamianReeves/write-file-action@v1.2
|
||||||
with:
|
with:
|
||||||
path: package.json
|
path: package.json
|
||||||
contents: |
|
contents: |
|
||||||
@@ -53,7 +57,7 @@ jobs:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
- name: Create release.mjs
|
- name: Create release.mjs
|
||||||
uses: DamianReeves/write-file-action@v1
|
uses: DamianReeves/write-file-action@v1.2
|
||||||
with:
|
with:
|
||||||
path: release.mjs
|
path: release.mjs
|
||||||
contents: |
|
contents: |
|
||||||
@@ -63,10 +67,28 @@ jobs:
|
|||||||
const sharp = require('sharp');
|
const sharp = require('sharp');
|
||||||
deepStrictEqual(['.jpg', '.jpeg', '.jpe'], sharp.format.jpeg.input.fileSuffix);
|
deepStrictEqual(['.jpg', '.jpeg', '.jpe'], sharp.format.jpeg.input.fileSuffix);
|
||||||
|
|
||||||
- name: Run with Node.js
|
- name: Run with Node.js + npm
|
||||||
run: |
|
run: |
|
||||||
npm install --ignore-scripts
|
npm install --ignore-scripts
|
||||||
node release.mjs
|
node release.mjs
|
||||||
|
rm -r node_modules/ package-lock.json
|
||||||
|
|
||||||
|
- name: Run with Node.js + pnpm
|
||||||
|
run: |
|
||||||
|
pnpm install --ignore-scripts
|
||||||
|
node release.mjs
|
||||||
|
rm -r node_modules/ pnpm-lock.yaml
|
||||||
|
|
||||||
|
- name: Run with Node.js + yarn
|
||||||
|
run: |
|
||||||
|
corepack enable
|
||||||
|
yarn set version stable
|
||||||
|
yarn config set enableScripts false
|
||||||
|
yarn config set nodeLinker node-modules
|
||||||
|
yarn install
|
||||||
|
node release.mjs
|
||||||
|
rm -r node_modules/ .yarn/ yarn.lock .yarnrc.yml
|
||||||
|
corepack disable
|
||||||
|
|
||||||
- name: Run with Deno
|
- name: Run with Deno
|
||||||
run: deno run --allow-read --allow-ffi release.mjs
|
run: deno run --allow-read --allow-ffi release.mjs
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
## versions
|
## versions
|
||||||
> versions
|
> versions
|
||||||
|
|
||||||
An Object containing the version numbers of sharp, libvips and its dependencies.
|
An Object containing the version numbers of sharp, libvips
|
||||||
|
and (when using prebuilt binaries) its dependencies.
|
||||||
|
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|||||||
@@ -5,13 +5,15 @@ npm install sharp
|
|||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
yarn add sharp
|
pnpm add sharp
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm add sharp
|
yarn add sharp
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Yarn Plug'n'Play is unsupported.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
* Node.js >= 18.17.0
|
* Node.js >= 18.17.0
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
15
lib/sharp.js
15
lib/sharp.js
@@ -30,11 +30,8 @@ try {
|
|||||||
help.push('Possible solutions:');
|
help.push('Possible solutions:');
|
||||||
// Common error messages
|
// Common error messages
|
||||||
if (prebuiltPlatforms.includes(runtimePlatform)) {
|
if (prebuiltPlatforms.includes(runtimePlatform)) {
|
||||||
help.push('- Add explicit dependencies for the runtime platform:');
|
help.push('- Add an explicit dependency for the runtime platform:');
|
||||||
help.push(` npm install --force @sharpen/sharp-${runtimePlatform}`);
|
help.push(` npm install --force @sharpen/sharp-${runtimePlatform}"`);
|
||||||
if (!isWindows) {
|
|
||||||
help.push(` npm install --force @sharpen/sharp-libvips-${runtimePlatform}`);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
help.push(`- The ${runtimePlatform} platform requires manual installation of libvips >= ${minimumLibvipsVersion}`);
|
help.push(`- The ${runtimePlatform} platform requires manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||||
}
|
}
|
||||||
@@ -43,7 +40,9 @@ try {
|
|||||||
const { engines } = require(`@sharpen/sharp-libvips-${runtimePlatform}/package`);
|
const { engines } = require(`@sharpen/sharp-libvips-${runtimePlatform}/package`);
|
||||||
const libcFound = `${familySync()} ${versionSync()}`;
|
const libcFound = `${familySync()} ${versionSync()}`;
|
||||||
const libcRequires = `${engines.musl ? 'musl' : 'glibc'} ${engines.musl || engines.glibc}`;
|
const libcRequires = `${engines.musl ? 'musl' : 'glibc'} ${engines.musl || engines.glibc}`;
|
||||||
help.push(`- Update your OS: found ${libcFound}, requires ${libcRequires}`);
|
help.push('- Update your OS:');
|
||||||
|
help.push(` Found ${libcFound}`);
|
||||||
|
help.push(` Requires ${libcRequires}`);
|
||||||
} catch (errEngines) {}
|
} catch (errEngines) {}
|
||||||
}
|
}
|
||||||
if (isMacOs && /Incompatible library version/.test(errLocal.message)) {
|
if (isMacOs && /Incompatible library version/.test(errLocal.message)) {
|
||||||
@@ -53,6 +52,10 @@ try {
|
|||||||
if (errPackage.code === 'ERR_DLOPEN_DISABLED') {
|
if (errPackage.code === 'ERR_DLOPEN_DISABLED') {
|
||||||
help.push('- Run Node.js without using the --no-addons flag');
|
help.push('- Run Node.js without using the --no-addons flag');
|
||||||
}
|
}
|
||||||
|
if (process.versions.pnp) {
|
||||||
|
help.push('- Use a supported yarn linker, either pnpm or node-modules:');
|
||||||
|
help.push(' yarn config set nodeLinker node-modules');
|
||||||
|
}
|
||||||
// Link to installation docs
|
// Link to installation docs
|
||||||
if (isLinux && /Module did not self-register/.test(errLocal.message + errPackage.message)) {
|
if (isLinux && /Module did not self-register/.test(errLocal.message + errPackage.message)) {
|
||||||
help.push('- Using worker threads on Linux? See https://sharp.pixelplumbing.com/install#worker-threads');
|
help.push('- Using worker threads on Linux? See https://sharp.pixelplumbing.com/install#worker-threads');
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ const is = require('./is');
|
|||||||
const { runtimePlatformArch } = require('./libvips');
|
const { runtimePlatformArch } = require('./libvips');
|
||||||
const sharp = require('./sharp');
|
const sharp = require('./sharp');
|
||||||
|
|
||||||
|
const runtimePlatform = runtimePlatformArch();
|
||||||
|
const libvipsVersion = sharp.libvipsVersion();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An Object containing nested boolean values representing the available input and output formats/methods.
|
* An Object containing nested boolean values representing the available input and output formats/methods.
|
||||||
* @member
|
* @member
|
||||||
@@ -44,20 +47,25 @@ const interpolators = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An Object containing the version numbers of sharp, libvips and its dependencies.
|
* An Object containing the version numbers of sharp, libvips
|
||||||
|
* and (when using prebuilt binaries) its dependencies.
|
||||||
|
*
|
||||||
* @member
|
* @member
|
||||||
* @example
|
* @example
|
||||||
* console.log(sharp.versions);
|
* console.log(sharp.versions);
|
||||||
*/
|
*/
|
||||||
let versions = {
|
let versions = {
|
||||||
vips: sharp.libvipsVersion()
|
vips: libvipsVersion.semver
|
||||||
};
|
};
|
||||||
try {
|
/* istanbul ignore next */
|
||||||
versions = require(`@sharpen/sharp-${runtimePlatformArch()}/versions`);
|
if (!libvipsVersion.isGlobal) {
|
||||||
} catch (_) {
|
|
||||||
try {
|
try {
|
||||||
versions = require(`@sharpen/sharp-libvips-${runtimePlatformArch()}/versions`);
|
versions = require(`@sharpen/sharp-${runtimePlatform}/versions`);
|
||||||
} catch (_) {}
|
} catch (_) {
|
||||||
|
try {
|
||||||
|
versions = require(`@sharpen/sharp-libvips-${runtimePlatform}/versions`);
|
||||||
|
} catch (_) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
versions.sharp = require('../package.json').version;
|
versions.sharp = require('../package.json').version;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp-darwin-arm64",
|
"name": "@sharpen/sharp-darwin-arm64",
|
||||||
"version": "0.0.1-alpha.6",
|
"version": "0.0.1-alpha.8",
|
||||||
"description": "Prebuilt sharp for use with macOS ARM64",
|
"description": "Prebuilt sharp for use with macOS ARM64",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -13,6 +13,9 @@
|
|||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@sharpen/sharp-libvips-darwin-arm64": "0.0.1-alpha.2"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp-darwin-x64",
|
"name": "@sharpen/sharp-darwin-x64",
|
||||||
"version": "0.0.1-alpha.6",
|
"version": "0.0.1-alpha.8",
|
||||||
"description": "Prebuilt sharp for use with macOS x64",
|
"description": "Prebuilt sharp for use with macOS x64",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -13,6 +13,9 @@
|
|||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@sharpen/sharp-libvips-darwin-x64": "0.0.1-alpha.2"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp-linux-arm",
|
"name": "@sharpen/sharp-linux-arm",
|
||||||
"version": "0.0.1-alpha.6",
|
"version": "0.0.1-alpha.8",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) ARM (32-bit)",
|
"description": "Prebuilt sharp for use with Linux (glibc) ARM (32-bit)",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -13,6 +13,9 @@
|
|||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@sharpen/sharp-libvips-linux-arm": "0.0.1-alpha.2"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp-linux-arm64",
|
"name": "@sharpen/sharp-linux-arm64",
|
||||||
"version": "0.0.1-alpha.6",
|
"version": "0.0.1-alpha.8",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) ARM64",
|
"description": "Prebuilt sharp for use with Linux (glibc) ARM64",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -13,6 +13,9 @@
|
|||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@sharpen/sharp-libvips-linux-arm64": "0.0.1-alpha.2"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp-linux-x64",
|
"name": "@sharpen/sharp-linux-x64",
|
||||||
"version": "0.0.1-alpha.6",
|
"version": "0.0.1-alpha.8",
|
||||||
"description": "Prebuilt sharp for use with Linux (glibc) x64",
|
"description": "Prebuilt sharp for use with Linux (glibc) x64",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -13,6 +13,9 @@
|
|||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@sharpen/sharp-libvips-linux-x64": "0.0.1-alpha.2"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp-linuxmusl-arm64",
|
"name": "@sharpen/sharp-linuxmusl-arm64",
|
||||||
"version": "0.0.1-alpha.6",
|
"version": "0.0.1-alpha.8",
|
||||||
"description": "Prebuilt sharp for use with Linux (musl) ARM64",
|
"description": "Prebuilt sharp for use with Linux (musl) ARM64",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -13,6 +13,9 @@
|
|||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@sharpen/sharp-libvips-linuxmusl-arm64": "0.0.1-alpha.2"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp-linuxmusl-x64",
|
"name": "@sharpen/sharp-linuxmusl-x64",
|
||||||
"version": "0.0.1-alpha.6",
|
"version": "0.0.1-alpha.8",
|
||||||
"description": "Prebuilt sharp for use with Linux (musl) x64",
|
"description": "Prebuilt sharp for use with Linux (musl) x64",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -13,6 +13,9 @@
|
|||||||
"url": "https://opencollective.com/libvips"
|
"url": "https://opencollective.com/libvips"
|
||||||
},
|
},
|
||||||
"preferUnplugged": true,
|
"preferUnplugged": true,
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@sharpen/sharp-libvips-linuxmusl-x64": "0.0.1-alpha.2"
|
||||||
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp",
|
"name": "@sharpen/sharp",
|
||||||
"version": "0.0.1-alpha.1",
|
"version": "0.0.1-alpha.8",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"darwin-x64",
|
"darwin-x64",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp-win32-ia32",
|
"name": "@sharpen/sharp-win32-ia32",
|
||||||
"version": "0.0.1-alpha.6",
|
"version": "0.0.1-alpha.8",
|
||||||
"description": "Prebuilt sharp for use with Windows x86 (32-bit)",
|
"description": "Prebuilt sharp for use with Windows x86 (32-bit)",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sharpen/sharp-win32-x64",
|
"name": "@sharpen/sharp-win32-x64",
|
||||||
"version": "0.0.1-alpha.6",
|
"version": "0.0.1-alpha.8",
|
||||||
"description": "Prebuilt sharp for use with Windows x64",
|
"description": "Prebuilt sharp for use with Windows x64",
|
||||||
"homepage": "https://sharp.pixelplumbing.com",
|
"homepage": "https://sharp.pixelplumbing.com",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
20
package.json
20
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "sharp",
|
"name": "sharp",
|
||||||
"description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",
|
"description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",
|
||||||
"version": "0.33.0-alpha.6",
|
"version": "0.33.0-alpha.8",
|
||||||
"author": "Lovell Fuller <npm@lovell.info>",
|
"author": "Lovell Fuller <npm@lovell.info>",
|
||||||
"homepage": "https://github.com/lovell/sharp",
|
"homepage": "https://github.com/lovell/sharp",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
@@ -139,8 +139,8 @@
|
|||||||
"semver": "^7.5.4"
|
"semver": "^7.5.4"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@sharpen/sharp-darwin-arm64": "0.0.1-alpha.6",
|
"@sharpen/sharp-darwin-arm64": "0.0.1-alpha.8",
|
||||||
"@sharpen/sharp-darwin-x64": "0.0.1-alpha.6",
|
"@sharpen/sharp-darwin-x64": "0.0.1-alpha.8",
|
||||||
"@sharpen/sharp-libvips-darwin-arm64": "0.0.1-alpha.2",
|
"@sharpen/sharp-libvips-darwin-arm64": "0.0.1-alpha.2",
|
||||||
"@sharpen/sharp-libvips-darwin-x64": "0.0.1-alpha.2",
|
"@sharpen/sharp-libvips-darwin-x64": "0.0.1-alpha.2",
|
||||||
"@sharpen/sharp-libvips-linux-arm": "0.0.1-alpha.2",
|
"@sharpen/sharp-libvips-linux-arm": "0.0.1-alpha.2",
|
||||||
@@ -148,13 +148,13 @@
|
|||||||
"@sharpen/sharp-libvips-linux-x64": "0.0.1-alpha.2",
|
"@sharpen/sharp-libvips-linux-x64": "0.0.1-alpha.2",
|
||||||
"@sharpen/sharp-libvips-linuxmusl-arm64": "0.0.1-alpha.2",
|
"@sharpen/sharp-libvips-linuxmusl-arm64": "0.0.1-alpha.2",
|
||||||
"@sharpen/sharp-libvips-linuxmusl-x64": "0.0.1-alpha.2",
|
"@sharpen/sharp-libvips-linuxmusl-x64": "0.0.1-alpha.2",
|
||||||
"@sharpen/sharp-linux-arm": "0.0.1-alpha.6",
|
"@sharpen/sharp-linux-arm": "0.0.1-alpha.8",
|
||||||
"@sharpen/sharp-linux-arm64": "0.0.1-alpha.6",
|
"@sharpen/sharp-linux-arm64": "0.0.1-alpha.8",
|
||||||
"@sharpen/sharp-linux-x64": "0.0.1-alpha.6",
|
"@sharpen/sharp-linux-x64": "0.0.1-alpha.8",
|
||||||
"@sharpen/sharp-linuxmusl-arm64": "0.0.1-alpha.6",
|
"@sharpen/sharp-linuxmusl-arm64": "0.0.1-alpha.8",
|
||||||
"@sharpen/sharp-linuxmusl-x64": "0.0.1-alpha.6",
|
"@sharpen/sharp-linuxmusl-x64": "0.0.1-alpha.8",
|
||||||
"@sharpen/sharp-win32-ia32": "0.0.1-alpha.6",
|
"@sharpen/sharp-win32-ia32": "0.0.1-alpha.8",
|
||||||
"@sharpen/sharp-win32-x64": "0.0.1-alpha.6"
|
"@sharpen/sharp-win32-x64": "0.0.1-alpha.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sharpen/sharp-libvips-dev": "0.0.1-alpha.2",
|
"@sharpen/sharp-libvips-dev": "0.0.1-alpha.2",
|
||||||
|
|||||||
@@ -111,6 +111,9 @@
|
|||||||
# 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': [
|
||||||
|
'SHARP_USE_GLOBAL_LIBVIPS'
|
||||||
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['OS == "linux"', {
|
['OS == "linux"', {
|
||||||
'defines': [
|
'defines': [
|
||||||
@@ -154,6 +157,7 @@
|
|||||||
'OTHER_LDFLAGS': [
|
'OTHER_LDFLAGS': [
|
||||||
# Ensure runtime linking is relative to sharp.node
|
# Ensure runtime linking is relative to sharp.node
|
||||||
'-Wl,-rpath,\'@loader_path/../../sharp-libvips-<(platform_and_arch)/lib\'',
|
'-Wl,-rpath,\'@loader_path/../../sharp-libvips-<(platform_and_arch)/lib\'',
|
||||||
|
'-Wl,-rpath,\'@loader_path/../../node_modules/@sharpen/sharp-libvips-<(platform_and_arch)/lib\'',
|
||||||
'-Wl,-rpath,\'@loader_path/../../../node_modules/@sharpen/sharp-libvips-<(platform_and_arch)/lib\''
|
'-Wl,-rpath,\'@loader_path/../../../node_modules/@sharpen/sharp-libvips-<(platform_and_arch)/lib\''
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -174,6 +178,7 @@
|
|||||||
'-Wl,-s',
|
'-Wl,-s',
|
||||||
'-Wl,--disable-new-dtags',
|
'-Wl,--disable-new-dtags',
|
||||||
'-Wl,-rpath=\'$$ORIGIN/../../sharp-libvips-<(platform_and_arch)/lib\'',
|
'-Wl,-rpath=\'$$ORIGIN/../../sharp-libvips-<(platform_and_arch)/lib\'',
|
||||||
|
'-Wl,-rpath=\'$$ORIGIN/../../node_modules/@sharpen/sharp-libvips-<(platform_and_arch)/lib\'',
|
||||||
'-Wl,-rpath=\'$$ORIGIN/../../../node_modules/@sharpen/sharp-libvips-<(platform_and_arch)/lib\''
|
'-Wl,-rpath=\'$$ORIGIN/../../../node_modules/@sharpen/sharp-libvips-<(platform_and_arch)/lib\''
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
#include <napi.h>
|
#include <napi.h>
|
||||||
#include <vips/vips8>
|
#include <vips/vips8>
|
||||||
@@ -91,9 +92,18 @@ Napi::Value simd(const Napi::CallbackInfo& info) {
|
|||||||
Get libvips version
|
Get libvips version
|
||||||
*/
|
*/
|
||||||
Napi::Value libvipsVersion(const Napi::CallbackInfo& info) {
|
Napi::Value libvipsVersion(const Napi::CallbackInfo& info) {
|
||||||
char version[9];
|
Napi::Env env = info.Env();
|
||||||
g_snprintf(version, sizeof(version), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2));
|
Napi::Object version = Napi::Object::New(env);
|
||||||
return Napi::String::New(info.Env(), version);
|
|
||||||
|
char semver[9];
|
||||||
|
std::snprintf(semver, sizeof(semver), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2));
|
||||||
|
version.Set("semver", Napi::String::New(env, semver));
|
||||||
|
#ifdef SHARP_USE_GLOBAL_LIBVIPS
|
||||||
|
version.Set("isGlobal", Napi::Boolean::New(env, true));
|
||||||
|
#else
|
||||||
|
version.Set("isGlobal", Napi::Boolean::New(env, false));
|
||||||
|
#endif
|
||||||
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user