Add support for 32-bit Windows (win32-ia32)

This commit is contained in:
Lovell Fuller 2020-02-19 21:44:13 +00:00
parent 8b3c0daab2
commit 409e5174bb
7 changed files with 23 additions and 10 deletions

View File

@ -20,7 +20,7 @@ Lanczos resampling ensures quality is not sacrificed for speed.
As well as image resizing, operations such as As well as image resizing, operations such as
rotation, extraction, compositing and gamma correction are available. rotation, extraction, compositing and gamma correction are available.
Most modern 64-bit macOS, Windows and Linux systems running Node.js v10.16.0+ Most modern macOS, Windows and Linux systems running Node.js v10.16.0+
do not require any additional install or runtime dependencies. do not require any additional install or runtime dependencies.
## Examples ## Examples

View File

@ -1,15 +1,22 @@
os: Visual Studio 2017 os: Visual Studio 2017
version: "{build}" version: "{build}"
build: off build: off
platform: x64
environment: environment:
matrix: matrix:
- nodejs_version: "10" - nodejs_version: "10"
platform: x86
- nodejs_version: "10"
platform: x64
- nodejs_version: "12" - nodejs_version: "12"
platform: x86
- nodejs_version: "12"
platform: x64
- nodejs_version: "13" - nodejs_version: "13"
platform: x86
- nodejs_version: "13"
platform: x64
install: install:
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) x64 - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform
- npm install -g npm@6
- npm install - npm install
test_script: test_script:
- npm test - npm test

View File

@ -30,6 +30,9 @@
'msvs_settings': { 'msvs_settings': {
'VCCLCompilerTool': { 'VCCLCompilerTool': {
'ExceptionHandling': 1 'ExceptionHandling': 1
},
'VCLinkerTool': {
'ImageHasSafeExceptionHandlers': 'false'
} }
}, },
'msvs_disabled_warnings': [ 'msvs_disabled_warnings': [
@ -194,6 +197,9 @@
'msvs_settings': { 'msvs_settings': {
'VCCLCompilerTool': { 'VCCLCompilerTool': {
'ExceptionHandling': 1 'ExceptionHandling': 1
},
'VCLinkerTool': {
'ImageHasSafeExceptionHandlers': 'false'
} }
}, },
'msvs_disabled_warnings': [ 'msvs_disabled_warnings': [

View File

@ -16,7 +16,7 @@ Lanczos resampling ensures quality is not sacrificed for speed.
As well as image resizing, operations such as As well as image resizing, operations such as
rotation, extraction, compositing and gamma correction are available. rotation, extraction, compositing and gamma correction are available.
Most modern 64-bit macOS, Windows and Linux systems running Node.js v10.16.0+ Most modern macOS, Windows and Linux systems running Node.js v10.16.0+
do not require any additional install or runtime dependencies. do not require any additional install or runtime dependencies.
[![Test Coverage](https://coveralls.io/repos/lovell/sharp/badge.png?branch=master)](https://coveralls.io/r/lovell/sharp?branch=master) [![Test Coverage](https://coveralls.io/repos/lovell/sharp/badge.png?branch=master)](https://coveralls.io/r/lovell/sharp?branch=master)

View File

@ -11,6 +11,9 @@ Requires libvips v8.9.1
* Migrate internals to N-API. * Migrate internals to N-API.
[#1282](https://github.com/lovell/sharp/issues/1282) [#1282](https://github.com/lovell/sharp/issues/1282)
* Add support for 32-bit Windows.
[#2088](https://github.com/lovell/sharp/issues/2088)
## v0.24 - "*wit*" ## v0.24 - "*wit*"
Requires libvips v8.9.0. Requires libvips v8.9.0.

View File

@ -19,7 +19,7 @@ Node.js v10.16.0+ (N-API v4) on the most common platforms:
* macOS x64 (>= 10.13) * macOS x64 (>= 10.13)
* Linux x64 (glibc >= 2.17, musl >= 1.1.24) * Linux x64 (glibc >= 2.17, musl >= 1.1.24)
* Windows x64 with 64-bit `node.exe` * Windows
A ~10MB tarball containing libvips and its most commonly used dependencies A ~10MB tarball containing libvips and its most commonly used dependencies
is downloaded via HTTPS and stored within `node_modules/sharp/vendor` during `npm install`. is downloaded via HTTPS and stored within `node_modules/sharp/vendor` during `npm install`.

View File

@ -57,10 +57,7 @@ try {
// Is this arch/platform supported? // Is this arch/platform supported?
const arch = process.env.npm_config_arch || process.arch; const arch = process.env.npm_config_arch || process.arch;
const platformAndArch = platform(); const platformAndArch = platform();
if (platformAndArch === 'win32-ia32') { if (arch === 'ia32' && !platformAndArch.startsWith('win32')) {
throw new Error('Windows x86 (32-bit) node.exe is not supported');
}
if (arch === 'ia32') {
throw new Error(`Intel Architecture 32-bit systems require manual installation of libvips >= ${minimumLibvipsVersion}`); throw new Error(`Intel Architecture 32-bit systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
} }
if (platformAndArch === 'freebsd-x64' || platformAndArch === 'openbsd-x64' || platformAndArch === 'sunos-x64') { if (platformAndArch === 'freebsd-x64' || platformAndArch === 'openbsd-x64' || platformAndArch === 'sunos-x64') {