diff --git a/.travis.yml b/.travis.yml index 84863043..8224666d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,59 @@ -language: node_js matrix: include: - - os: linux - dist: trusty - sudo: false - node_js: "4" - - os: linux + - name: "Linux (glibc) - Node 6" + os: linux dist: trusty sudo: false + language: node_js node_js: "6" - - os: linux + - name: "Linux (glibc) - Node 8" + os: linux dist: trusty sudo: false + language: node_js node_js: "8" - - os: linux + - name: "Linux (glibc) - Node 10" + os: linux dist: trusty sudo: false + language: node_js node_js: "10" - - os: osx - osx_image: xcode8.3 - node_js: "4" - - os: osx - osx_image: xcode8.3 + after_success: + - npm install coveralls + - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + - name: "Linux (musl) - Node 8" + os: linux + dist: trusty + sudo: true + language: minimal + before_install: + - sudo docker run -dit --name sharp --env CI --env PREBUILD_TOKEN --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:8-alpine + - sudo docker exec sharp apk add build-base git python2 --update-cache + install: sudo docker exec sharp sh -c "npm install --unsafe-perm" + script: sudo docker exec sharp sh -c "npm test" + - name: "Linux (musl) - Node 10" + os: linux + dist: trusty + sudo: true + language: minimal + before_install: + - sudo docker run -dit --name sharp --env CI --env PREBUILD_TOKEN --volume "${PWD}:/mnt/sharp" --workdir /mnt/sharp node:10-alpine + - sudo docker exec sharp apk add build-base git python2 --update-cache + install: sudo docker exec sharp sh -c "npm install --unsafe-perm" + script: sudo docker exec sharp sh -c "npm test" + allow_failures: + - name: "OS X - Node 6" + os: osx + osx_image: xcode9.2 + language: node_js node_js: "6" - - os: osx - osx_image: xcode8.3 + - name: "OS X - Node 8" + os: osx + osx_image: xcode9.2 + language: node_js node_js: "8" - - os: osx - osx_image: xcode8.3 + - name: "OS X - Node 10" + os: osx + osx_image: xcode9.2 + language: node_js node_js: "10" -after_success: - - npm install coveralls - - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js diff --git a/README.md b/README.md index c55099f6..d549868d 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ Lanczos resampling ensures quality is not sacrificed for speed. As well as image resizing, operations such as rotation, extraction, compositing and gamma correction are available. -Most modern 64-bit OS X, Windows and Linux (glibc) systems running -Node versions 4, 6, 8 and 10 +Most modern 64-bit OS X, Windows and Linux systems running +Node versions 6, 8 and 10 do not require any additional install or runtime dependencies. ## Examples diff --git a/appveyor.yml b/appveyor.yml index 2e0f1662..5350bba1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,6 @@ build: off platform: x64 environment: matrix: - - nodejs_version: "4" - nodejs_version: "6" - nodejs_version: "8" - nodejs_version: "10" diff --git a/binding.gyp b/binding.gyp index 1115b1cd..bf2e5ad8 100644 --- a/binding.gyp +++ b/binding.gyp @@ -128,9 +128,11 @@ '../vendor/lib/libcairo.so', '../vendor/lib/libcroco-0.6.so', '../vendor/lib/libexif.so', + '../vendor/lib/libexpat.so', '../vendor/lib/libffi.so', '../vendor/lib/libfontconfig.so', '../vendor/lib/libfreetype.so', + '../vendor/lib/libfribidi.so', '../vendor/lib/libgdk_pixbuf-2.0.so', '../vendor/lib/libgif.so', '../vendor/lib/libgio-2.0.so', @@ -138,6 +140,7 @@ '../vendor/lib/libgsf-1.so', '../vendor/lib/libgthread-2.0.so', '../vendor/lib/libharfbuzz.so', + '../vendor/lib/libharfbuzz-subset.so.0', '../vendor/lib/libjpeg.so', '../vendor/lib/liblcms2.so', '../vendor/lib/liborc-0.4.so', @@ -149,6 +152,8 @@ '../vendor/lib/librsvg-2.so', '../vendor/lib/libtiff.so', '../vendor/lib/libwebp.so', + '../vendor/lib/libwebpdemux.so', + '../vendor/lib/libwebpmux.so', '../vendor/lib/libxml2.so', '../vendor/lib/libz.so', # Ensure runtime linking is relative to sharp.node diff --git a/docs/changelog.md b/docs/changelog.md index 397997d0..53b9c83f 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,17 @@ # Changelog +### v0.21 - "*teeth*" + +Requires libvips v8.7.0. + +#### v0.21.0 - TBD + +* Drop Node 4 support. + [#1212](https://github.com/lovell/sharp/issues/1212) + +* Add experimental prebuilt binaries for musl-based Linux. + [#1379](https://github.com/lovell/sharp/issues/1379) + ### v0.20 - "*prebuild*" Requires libvips v8.6.1. diff --git a/docs/index.md b/docs/index.md index 2af321c7..236ef3fd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,8 +13,8 @@ Lanczos resampling ensures quality is not sacrificed for speed. As well as image resizing, operations such as rotation, extraction, compositing and gamma correction are available. -Most 64-bit OS X, Windows and Linux (glibc) systems running -Node versions 4, 6, 8 and 10 +Most modern 64-bit OS X, Windows and Linux systems running +Node versions 6, 8 and 10 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) diff --git a/docs/install.md b/docs/install.md index 15314074..eedfdb67 100644 --- a/docs/install.md +++ b/docs/install.md @@ -15,7 +15,7 @@ yarn add sharp ### Building from source Pre-compiled binaries for sharp are provided for use with -Node versions 4, 6, 8 and 10 on +Node versions 6, 8 and 10 on 64-bit Windows, OS X and Linux platforms. Sharp will be built from source at install time when: @@ -27,7 +27,7 @@ Sharp will be built from source at install time when: Building from source requires: * C++11 compatible compiler such as gcc 4.8+, clang 3.0+ or MSVC 2013+ -* [node-gyp](https://github.com/TooTallNate/node-gyp#installation) and its dependencies (includes Python) +* [node-gyp](https://github.com/nodejs/node-gyp#installation) and its dependencies (includes Python 2.7) ## libvips @@ -36,13 +36,14 @@ Building from source requires: [![Ubuntu 16.04 Build Status](https://travis-ci.org/lovell/sharp.png?branch=master)](https://travis-ci.org/lovell/sharp) libvips and its dependencies are fetched and stored within `node_modules/sharp/vendor` during `npm install`. -This involves an automated HTTPS download of approximately 7MB. +This involves an automated HTTPS download of approximately 8MB. -Most recent Linux-based operating systems with glibc running on x64 and ARMv6+ CPUs should "just work", e.g.: +Most Linux-based (glibc, musl) operating systems running on x64 and ARMv6+ CPUs should "just work", e.g.: * Debian 7+ * Ubuntu 14.04+ * Centos 7+ +* Alpine 3.8+ (Node 8 and 10) * Fedora * openSUSE 13.2+ * Archlinux @@ -61,9 +62,9 @@ and `LD_LIBRARY_PATH` at runtime. This allows the use of newer versions of libvips with older versions of sharp. For 32-bit Intel CPUs and older Linux-based operating systems such as Centos 6, -it is recommended to install a system-wide installation of libvips from source: +compiling libvips from source is recommended. -https://jcupitt.github.io/libvips/install.html#building-libvips-from-a-source-tarball +[https://jcupitt.github.io/libvips/install.html#building-libvips-from-a-source-tarball](https://jcupitt.github.io/libvips/install.html#building-libvips-from-a-source-tarball) #### Alpine Linux @@ -71,7 +72,7 @@ libvips is available in the [testing repository](https://pkgs.alpinelinux.org/packages?name=vips-dev): ```sh -apk add vips-dev fftw-dev --update-cache --repository https://dl-3.alpinelinux.org/alpine/edge/testing/ +apk add vips-dev fftw-dev build-base --update-cache --repository https://dl-3.alpinelinux.org/alpine/edge/testing/ ``` The smaller stack size of musl libc means @@ -94,7 +95,7 @@ that it can be located using `pkg-config --modversion vips-cpp`. [![Windows x64 Build Status](https://ci.appveyor.com/api/projects/status/pgtul704nkhhg6sg)](https://ci.appveyor.com/project/lovell/sharp) libvips and its dependencies are fetched and stored within `node_modules\sharp\vendor` during `npm install`. -This involves an automated HTTPS download of approximately 12MB. +This involves an automated HTTPS download of approximately 13MB. Only 64-bit (x64) `node.exe` is supported. @@ -117,9 +118,6 @@ https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193528 ### Heroku -libvips and its dependencies are fetched and stored within `node_modules\sharp\vendor` during `npm install`. -This involves an automated HTTPS download of approximately 7MB. - Set [NODE_MODULES_CACHE](https://devcenter.heroku.com/articles/nodejs-support#cache-behavior) to `false` when using the `yarn` package manager. @@ -154,12 +152,13 @@ can be built using Docker. ```sh rm -rf node_modules/sharp -docker run -v "$PWD":/var/task lambci/lambda:build-nodejs6.10 npm install +docker run -v "$PWD":/var/task lambci/lambda:build-nodejs8.10 npm install ``` -Set the Lambda runtime to Node.js 6.10. +Set the Lambda runtime to Node.js 8.10. -To get the best performance select the largest memory available. A 1536 MB function provides ~12x more CPU time than a 128 MB function. +To get the best performance select the largest memory available. +A 1536 MB function provides ~12x more CPU time than a 128 MB function. ### NW.js @@ -171,7 +170,7 @@ nw-gyp rebuild --arch=x64 --target=[your nw version] node node_modules/sharp/install/dll-copy ``` -See also http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/ +[http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/](http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/) ### Build tools @@ -199,28 +198,6 @@ and [Valgrind](http://valgrind.org/) have been used to test the most popular web-based formats, as well as libvips itself, you are advised to perform your own testing and sandboxing. -ImageMagick in particular has a relatively large attack surface, -which can be partially mitigated with a -[policy.xml](http://www.imagemagick.org/script/resources.php) -configuration file to prevent the use of coders known to be vulnerable. - -```xml - - - - - - - - - - - -``` - -Set the `MAGICK_CONFIGURE_PATH` environment variable -to the directory containing the `policy.xml` file. - ### Pre-compiled libvips binaries This module will attempt to download a pre-compiled bundle of libvips @@ -236,7 +213,8 @@ SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install sharp ``` Should you need to manually download and inspect these files, -you can do so via https://github.com/lovell/sharp-libvips/releases +you can do so via +[https://github.com/lovell/sharp-libvips/releases](https://github.com/lovell/sharp-libvips/releases) Should you wish to install these from your own location, set the `SHARP_DIST_BASE_URL` environment variable, e.g. @@ -265,6 +243,8 @@ Use of libraries under the terms of the LGPLv3 is via the | expat | MIT Licence | | fontconfig | [fontconfig Licence](https://cgit.freedesktop.org/fontconfig/tree/COPYING) (BSD-like) | | freetype | [freetype Licence](http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/FTL.TXT) (BSD-like) | +| fribidi | LGPLv3 | +| gettext | LGPLv3 | | giflib | MIT Licence | | glib | LGPLv3 | | harfbuzz | MIT Licence | diff --git a/install/libvips.js b/install/libvips.js index 5562a861..315a9812 100644 --- a/install/libvips.js +++ b/install/libvips.js @@ -54,9 +54,6 @@ try { if (platformAndArch === 'freebsd-x64') { throw new Error(`FreeBSD systems require manual installation of libvips >= ${minimumLibvipsVersion}`); } - if (detectLibc.isNonGlibcLinux) { - throw new Error(`Use with ${detectLibc.family} libc requires manual installation of libvips >= ${minimumLibvipsVersion}`); - } if (detectLibc.family === detectLibc.GLIBC && detectLibc.version && semver.lt(`${detectLibc.version}.0`, '2.13.0')) { throw new Error(`Use with glibc version ${detectLibc.version} requires manual installation of libvips >= ${minimumLibvipsVersion}`); } diff --git a/lib/libvips.js b/lib/libvips.js index eaafe431..4f5fed1c 100644 --- a/lib/libvips.js +++ b/lib/libvips.js @@ -44,10 +44,16 @@ const globalLibvipsVersion = function () { const hasVendoredLibvips = function () { const currentPlatformId = platform(); + const vendorPath = path.join(__dirname, '..', 'vendor'); + let vendorVersionId; let vendorPlatformId; try { - vendorPlatformId = require(path.join(__dirname, '..', 'vendor', 'platform.json')); + vendorVersionId = require(path.join(vendorPath, 'versions.json')).vips; + vendorPlatformId = require(path.join(vendorPath, 'platform.json')); } catch (err) {} + if (vendorVersionId && vendorVersionId !== minimumLibvipsVersion) { + throw new Error(`Found vendored libvips v${vendorVersionId} but require v${minimumLibvipsVersion}. Please remove the 'node_modules/sharp/vendor' directory and run 'npm install'.`); + } if (vendorPlatformId) { if (currentPlatformId === vendorPlatformId) { return true; diff --git a/lib/platform.js b/lib/platform.js index 0d0722ba..4bddd0ab 100644 --- a/lib/platform.js +++ b/lib/platform.js @@ -1,10 +1,13 @@ 'use strict'; +const detectLibc = require('detect-libc'); + module.exports = function () { const arch = process.env.npm_config_arch || process.arch; const platform = process.env.npm_config_platform || process.platform; + const libc = (platform === 'linux' && detectLibc.isNonGlibcLinux) ? detectLibc.family : ''; - const platformId = [platform]; + const platformId = [`${platform}${libc}`]; if (arch === 'arm' || arch === 'armhf' || arch === 'arm64') { const armVersion = (arch === 'arm64') ? '8' : process.env.npm_config_armv || process.config.variables.arm_version || '6'; platformId.push(`armv${armVersion}`); diff --git a/package.json b/package.json index dba40ab3..520c0cbc 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ ], "scripts": { "install": "(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)", - "clean": "rm -rf node_modules/ build/ vendor/ coverage/ test/fixtures/output.*", + "clean": "rm -rf node_modules/ build/ vendor/ .nyc_output/ coverage/ test/fixtures/output.*", "test": "semistandard && cc && nyc --reporter=lcov --branches=99 mocha --slow=5000 --timeout=60000 ./test/unit/*.js && prebuild-ci", "coverage": "./test/coverage/report.sh", "test-leak": "./test/leak/leak.sh", @@ -91,9 +91,9 @@ "nan": "^2.11.0", "fs-copy-file-sync": "^1.1.1", "npmlog": "^4.1.2", - "prebuild-install": "^4.0.0", + "prebuild-install": "^5.0.0", "semver": "^5.5.1", - "simple-get": "^2.8.1", + "simple-get": "^3.0.3", "tar": "^4.4.6", "tunnel-agent": "^0.6.0" }, @@ -105,19 +105,19 @@ "exif-reader": "^1.0.2", "icc": "^1.0.0", "mocha": "^5.2.0", - "mock-fs": "^4.6.0", - "nyc": "^12.0.1", - "prebuild": "^7.6.2", + "mock-fs": "^4.7.0", + "nyc": "^13.1.0", + "prebuild": "^8.0.1", "prebuild-ci": "^2.2.3", "rimraf": "^2.6.2", "semistandard": "^12.0.1" }, "license": "Apache-2.0", "config": { - "libvips": "8.6.1" + "libvips": "8.7.0" }, "engines": { - "node": ">=4.5.0" + "node": ">=6" }, "semistandard": { "env": [ diff --git a/src/common.cc b/src/common.cc index 6d82d04d..ee9519d2 100644 --- a/src/common.cc +++ b/src/common.cc @@ -370,10 +370,6 @@ namespace sharp { if (image.width() > 65535 || image.height() > 65535) { throw vips::VError("Processed image is too large for the JPEG format"); } - } else if (imageType == ImageType::PNG) { - if (image.width() > 2147483647 || image.height() > 2147483647) { - throw vips::VError("Processed image is too large for the PNG format"); - } } else if (imageType == ImageType::WEBP) { if (image.width() > 16383 || image.height() > 16383) { throw vips::VError("Processed image is too large for the WebP format"); diff --git a/src/libvips/cplusplus/VImage.cpp b/src/libvips/cplusplus/VImage.cpp index da1eef17..3c1acd98 100644 --- a/src/libvips/cplusplus/VImage.cpp +++ b/src/libvips/cplusplus/VImage.cpp @@ -613,7 +613,7 @@ VImage::new_matrixv( int width, int height, ... ) } VImage -VImage::write( VImage out ) +VImage::write( VImage out ) const { if( vips_image_write( this->get_image(), out.get_image() ) ) throw VError(); @@ -622,7 +622,7 @@ VImage::write( VImage out ) } void -VImage::write_to_file( const char *name, VOption *options ) +VImage::write_to_file( const char *name, VOption *options ) const { char filename[VIPS_PATH_MAX]; char option_string[VIPS_PATH_MAX]; @@ -642,7 +642,7 @@ VImage::write_to_file( const char *name, VOption *options ) void VImage::write_to_buffer( const char *suffix, void **buf, size_t *size, - VOption *options ) + VOption *options ) const { char filename[VIPS_PATH_MAX]; char option_string[VIPS_PATH_MAX]; @@ -675,7 +675,7 @@ VImage::write_to_buffer( const char *suffix, void **buf, size_t *size, #include "vips-operators.cpp" std::vector -VImage::bandsplit( VOption *options ) +VImage::bandsplit( VOption *options ) const { std::vector b; @@ -686,7 +686,7 @@ VImage::bandsplit( VOption *options ) } VImage -VImage::bandjoin( VImage other, VOption *options ) +VImage::bandjoin( VImage other, VOption *options ) const { VImage v[2] = { *this, other }; std::vector vec( v, v + VIPS_NUMBER( v ) ); @@ -695,7 +695,7 @@ VImage::bandjoin( VImage other, VOption *options ) } VImage -VImage::composite( VImage other, VipsBlendMode mode, VOption *options ) +VImage::composite( VImage other, VipsBlendMode mode, VOption *options ) const { VImage v[2] = { *this, other }; std::vector ivec( v, v + VIPS_NUMBER( v ) ); @@ -706,7 +706,7 @@ VImage::composite( VImage other, VipsBlendMode mode, VOption *options ) } std::complex -VImage::minpos( VOption *options ) +VImage::minpos( VOption *options ) const { double x, y; @@ -719,7 +719,7 @@ VImage::minpos( VOption *options ) } std::complex -VImage::maxpos( VOption *options ) +VImage::maxpos( VOption *options ) const { double x, y; @@ -734,43 +734,43 @@ VImage::maxpos( VOption *options ) // Operator overloads VImage -VImage::operator[]( int index ) +VImage::operator[]( int index ) const { return( this->extract_band( index ) ); } std::vector -VImage::operator()( int x, int y ) +VImage::operator()( int x, int y ) const { return( this->getpoint( x, y ) ); } VImage -operator+( VImage a, VImage b ) +operator+( const VImage a, const VImage b ) { return( a.add( b ) ); } VImage -operator+( double a, VImage b ) +operator+( double a, const VImage b ) { return( b.linear( 1.0, a ) ); } VImage -operator+( VImage a, double b ) +operator+( const VImage a, double b ) { return( a.linear( 1.0, b ) ); } VImage -operator+( std::vector a, VImage b ) +operator+( const std::vector a, const VImage b ) { return( b.linear( 1.0, a ) ); } VImage -operator+( VImage a, std::vector b ) +operator+( const VImage a, const std::vector b ) { return( a.linear( 1.0, b ) ); } @@ -788,37 +788,37 @@ operator+=( VImage &a, const double b ) } VImage & -operator+=( VImage &a, std::vector b ) +operator+=( VImage &a, const std::vector b ) { return( a = a + b ); } VImage -operator-( VImage a, VImage b ) +operator-( const VImage a, const VImage b ) { return( a.subtract( b ) ); } VImage -operator-( double a, VImage b ) +operator-( double a, const VImage b ) { return( b.linear( -1.0, a ) ); } VImage -operator-( VImage a, double b ) +operator-( const VImage a, double b ) { return( a.linear( 1.0, -b ) ); } VImage -operator-( std::vector a, VImage b ) +operator-( const std::vector a, const VImage b ) { return( b.linear( -1.0, a ) ); } VImage -operator-( VImage a, std::vector b ) +operator-( const VImage a, const std::vector b ) { return( a.linear( 1.0, vips::negate( b ) ) ); } @@ -836,43 +836,43 @@ operator-=( VImage &a, const double b ) } VImage & -operator-=( VImage &a, std::vector b ) +operator-=( VImage &a, const std::vector b ) { return( a = a - b ); } VImage -operator-( VImage a ) +operator-( const VImage a ) { return( a * -1 ); } VImage -operator*( VImage a, VImage b ) +operator*( const VImage a, const VImage b ) { return( a.multiply( b ) ); } VImage -operator*( double a, VImage b ) +operator*( double a, const VImage b ) { return( b.linear( a, 0.0 ) ); } VImage -operator*( VImage a, double b ) +operator*( const VImage a, double b ) { return( a.linear( b, 0.0 ) ); } VImage -operator*( std::vector a, VImage b ) +operator*( const std::vector a, const VImage b ) { return( b.linear( a, 0.0 ) ); } VImage -operator*( VImage a, std::vector b ) +operator*( const VImage a, const std::vector b ) { return( a.linear( b, 0.0 ) ); } @@ -890,37 +890,37 @@ operator*=( VImage &a, const double b ) } VImage & -operator*=( VImage &a, std::vector b ) +operator*=( VImage &a, const std::vector b ) { return( a = a * b ); } VImage -operator/( VImage a, VImage b ) +operator/( const VImage a, const VImage b ) { return( a.divide( b ) ); } VImage -operator/( double a, VImage b ) +operator/( double a, const VImage b ) { return( b.pow( -1.0 ).linear( a, 0.0 ) ); } VImage -operator/( VImage a, double b ) +operator/( const VImage a, double b ) { return( a.linear( 1.0 / b, 0.0 ) ); } VImage -operator/( std::vector a, VImage b ) +operator/( const std::vector a, const VImage b ) { return( b.pow( -1.0 ).linear( a, 0.0 ) ); } VImage -operator/( VImage a, std::vector b ) +operator/( const VImage a, const std::vector b ) { return( a.linear( vips::invert( b ), 0.0 ) ); } @@ -938,25 +938,25 @@ operator/=( VImage &a, const double b ) } VImage & -operator/=( VImage &a, std::vector b ) +operator/=( VImage &a, const std::vector b ) { return( a = a / b ); } VImage -operator%( VImage a, VImage b ) +operator%( const VImage a, const VImage b ) { return( a.remainder( b ) ); } VImage -operator%( VImage a, double b ) +operator%( const VImage a, const double b ) { return( a.remainder_const( to_vector( b ) ) ); } VImage -operator%( VImage a, std::vector b ) +operator%( const VImage a, const std::vector b ) { return( a.remainder_const( b ) ); } @@ -974,243 +974,243 @@ operator%=( VImage &a, const double b ) } VImage & -operator%=( VImage &a, std::vector b ) +operator%=( VImage &a, const std::vector b ) { return( a = a % b ); } VImage -operator<( VImage a, VImage b ) +operator<( const VImage a, const VImage b ) { return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESS ) ); } VImage -operator<( double a, VImage b ) +operator<( const double a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_MORE, to_vector( a ) ) ); } VImage -operator<( VImage a, double b ) +operator<( const VImage a, const double b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESS, to_vector( b ) ) ); } VImage -operator<( std::vector a, VImage b ) +operator<( const std::vector a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_MORE, a ) ); } VImage -operator<( VImage a, std::vector b ) +operator<( const VImage a, const std::vector b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESS, b ) ); } VImage -operator<=( VImage a, VImage b ) +operator<=( const VImage a, const VImage b ) { return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESSEQ ) ); } VImage -operator<=( double a, VImage b ) +operator<=( const double a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, to_vector( a ) ) ); } VImage -operator<=( VImage a, double b ) +operator<=( const VImage a, const double b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, to_vector( b ) ) ); } VImage -operator<=( std::vector a, VImage b ) +operator<=( const std::vector a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, a ) ); } VImage -operator<=( VImage a, std::vector b ) +operator<=( const VImage a, const std::vector b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, b ) ); } VImage -operator>( VImage a, VImage b ) +operator>( const VImage a, const VImage b ) { return( a.relational( b, VIPS_OPERATION_RELATIONAL_MORE ) ); } VImage -operator>( double a, VImage b ) +operator>( const double a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESS, to_vector( a ) ) ); } VImage -operator>( VImage a, double b ) +operator>( const VImage a, const double b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_MORE, to_vector( b ) ) ); } VImage -operator>( std::vector a, VImage b ) +operator>( const std::vector a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESS, a ) ); } VImage -operator>( VImage a, std::vector b ) +operator>( const VImage a, const std::vector b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_MORE, b ) ); } VImage -operator>=( VImage a, VImage b ) +operator>=( const VImage a, const VImage b ) { return( a.relational( b, VIPS_OPERATION_RELATIONAL_MOREEQ ) ); } VImage -operator>=( double a, VImage b ) +operator>=( const double a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, to_vector( a ) ) ); } VImage -operator>=( VImage a, double b ) +operator>=( const VImage a, const double b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, to_vector( b ) ) ); } VImage -operator>=( std::vector a, VImage b ) +operator>=( const std::vector a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, a ) ); } VImage -operator>=( VImage a, std::vector b ) +operator>=( const VImage a, const std::vector b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, b ) ); } VImage -operator==( VImage a, VImage b ) +operator==( const VImage a, const VImage b ) { return( a.relational( b, VIPS_OPERATION_RELATIONAL_EQUAL ) ); } VImage -operator==( double a, VImage b ) +operator==( const double a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL, to_vector( a ) ) ); } VImage -operator==( VImage a, double b ) +operator==( const VImage a, const double b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL, to_vector( b ) ) ); } VImage -operator==( std::vector a, VImage b ) +operator==( const std::vector a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL, a ) ); } VImage -operator==( VImage a, std::vector b ) +operator==( const VImage a, const std::vector b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL, b ) ); } VImage -operator!=( VImage a, VImage b ) +operator!=( const VImage a, const VImage b ) { return( a.relational( b, VIPS_OPERATION_RELATIONAL_NOTEQ ) ); } VImage -operator!=( double a, VImage b ) +operator!=( const double a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ, to_vector( a ) ) ); } VImage -operator!=( VImage a, double b ) +operator!=( const VImage a, const double b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ, to_vector( b ) ) ); } VImage -operator!=( std::vector a, VImage b ) +operator!=( const std::vector a, const VImage b ) { return( b.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ, a ) ); } VImage -operator!=( VImage a, std::vector b ) +operator!=( const VImage a, const std::vector b ) { return( a.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ, b ) ); } VImage -operator&( VImage a, VImage b ) +operator&( const VImage a, const VImage b ) { return( a.boolean( b, VIPS_OPERATION_BOOLEAN_AND ) ); } VImage -operator&( double a, VImage b ) +operator&( const double a, const VImage b ) { return( b.boolean_const( VIPS_OPERATION_BOOLEAN_AND, to_vector( a ) ) ); } VImage -operator&( VImage a, double b ) +operator&( const VImage a, const double b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_AND, to_vector( b ) ) ); } VImage -operator&( std::vector a, VImage b ) +operator&( const std::vector a, const VImage b ) { return( b.boolean_const( VIPS_OPERATION_BOOLEAN_AND, a ) ); } VImage -operator&( VImage a, std::vector b ) +operator&( const VImage a, const std::vector b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_AND, b ) ); } @@ -1228,40 +1228,40 @@ operator&=( VImage &a, const double b ) } VImage & -operator&=( VImage &a, std::vector b ) +operator&=( VImage &a, const std::vector b ) { return( a = a & b ); } VImage -operator|( VImage a, VImage b ) +operator|( const VImage a, const VImage b ) { return( a.boolean( b, VIPS_OPERATION_BOOLEAN_OR ) ); } VImage -operator|( double a, VImage b ) +operator|( const double a, const VImage b ) { return( b.boolean_const( VIPS_OPERATION_BOOLEAN_OR, to_vector( a ) ) ); } VImage -operator|( VImage a, double b ) +operator|( const VImage a, const double b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_OR, to_vector( b ) ) ); } VImage -operator|( std::vector a, VImage b ) +operator|( const std::vector a, const VImage b ) { return( b.boolean_const( VIPS_OPERATION_BOOLEAN_OR, a ) ); } VImage -operator|( VImage a, std::vector b ) +operator|( const VImage a, const std::vector b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_OR, b ) ); @@ -1280,40 +1280,40 @@ operator|=( VImage &a, const double b ) } VImage & -operator|=( VImage &a, std::vector b ) +operator|=( VImage &a, const std::vector b ) { return( a = a | b ); } VImage -operator^( VImage a, VImage b ) +operator^( const VImage a, const VImage b ) { return( a.boolean( b, VIPS_OPERATION_BOOLEAN_EOR ) ); } VImage -operator^( double a, VImage b ) +operator^( const double a, const VImage b ) { return( b.boolean_const( VIPS_OPERATION_BOOLEAN_EOR, to_vector( a ) ) ); } VImage -operator^( VImage a, double b ) +operator^( const VImage a, const double b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_EOR, to_vector( b ) ) ); } VImage -operator^( std::vector a, VImage b ) +operator^( const std::vector a, const VImage b ) { return( b.boolean_const( VIPS_OPERATION_BOOLEAN_EOR, a ) ); } VImage -operator^( VImage a, std::vector b ) +operator^( const VImage a, const std::vector b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_EOR, b ) ); @@ -1332,26 +1332,26 @@ operator^=( VImage &a, const double b ) } VImage & -operator^=( VImage &a, std::vector b ) +operator^=( VImage &a, const std::vector b ) { return( a = a ^ b ); } VImage -operator<<( VImage a, VImage b ) +operator<<( const VImage a, const VImage b ) { return( a.boolean( b, VIPS_OPERATION_BOOLEAN_LSHIFT ) ); } VImage -operator<<( VImage a, double b ) +operator<<( const VImage a, const double b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_LSHIFT, to_vector( b ) ) ); } VImage -operator<<( VImage a, std::vector b ) +operator<<( const VImage a, const std::vector b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_LSHIFT, b ) ); @@ -1370,26 +1370,26 @@ operator<<=( VImage &a, const double b ) } VImage & -operator<<=( VImage &a, std::vector b ) +operator<<=( VImage &a, const std::vector b ) { return( a = a << b ); } VImage -operator>>( VImage a, VImage b ) +operator>>( const VImage a, const VImage b ) { return( a.boolean( b, VIPS_OPERATION_BOOLEAN_RSHIFT ) ); } VImage -operator>>( VImage a, double b ) +operator>>( const VImage a, const double b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_RSHIFT, to_vector( b ) ) ); } VImage -operator>>( VImage a, std::vector b ) +operator>>( const VImage a, const std::vector b ) { return( a.boolean_const( VIPS_OPERATION_BOOLEAN_RSHIFT, b ) ); @@ -1408,7 +1408,7 @@ operator>>=( VImage &a, const double b ) } VImage & -operator>>=( VImage &a, std::vector b ) +operator>>=( VImage &a, const std::vector b ) { return( a = a << b ); } diff --git a/src/libvips/cplusplus/vips-operators.cpp b/src/libvips/cplusplus/vips-operators.cpp index 02097139..9f22ffe4 100644 --- a/src/libvips/cplusplus/vips-operators.cpp +++ b/src/libvips/cplusplus/vips-operators.cpp @@ -1,5 +1,5 @@ // bodies for vips operations -// Sun 26 Nov 17:44:23 GMT 2017 +// Mon 11 Jun 14:28:56 BST 2018 // this file is generated automatically, do not edit! void VImage::system( char * cmd_format , VOption *options ) @@ -9,7 +9,7 @@ void VImage::system( char * cmd_format , VOption *options ) set( "cmd-format", cmd_format ) ); } -VImage VImage::add( VImage right , VOption *options ) +VImage VImage::add( VImage right , VOption *options ) const { VImage out; @@ -22,7 +22,7 @@ VImage VImage::add( VImage right , VOption *options ) return( out ); } -VImage VImage::subtract( VImage right , VOption *options ) +VImage VImage::subtract( VImage right , VOption *options ) const { VImage out; @@ -35,7 +35,7 @@ VImage VImage::subtract( VImage right , VOption *options ) return( out ); } -VImage VImage::multiply( VImage right , VOption *options ) +VImage VImage::multiply( VImage right , VOption *options ) const { VImage out; @@ -48,7 +48,7 @@ VImage VImage::multiply( VImage right , VOption *options ) return( out ); } -VImage VImage::divide( VImage right , VOption *options ) +VImage VImage::divide( VImage right , VOption *options ) const { VImage out; @@ -61,7 +61,7 @@ VImage VImage::divide( VImage right , VOption *options ) return( out ); } -VImage VImage::relational( VImage right , VipsOperationRelational relational , VOption *options ) +VImage VImage::relational( VImage right , VipsOperationRelational relational , VOption *options ) const { VImage out; @@ -75,7 +75,7 @@ VImage VImage::relational( VImage right , VipsOperationRelational relational , V return( out ); } -VImage VImage::remainder( VImage right , VOption *options ) +VImage VImage::remainder( VImage right , VOption *options ) const { VImage out; @@ -88,7 +88,7 @@ VImage VImage::remainder( VImage right , VOption *options ) return( out ); } -VImage VImage::boolean( VImage right , VipsOperationBoolean boolean , VOption *options ) +VImage VImage::boolean( VImage right , VipsOperationBoolean boolean , VOption *options ) const { VImage out; @@ -102,7 +102,7 @@ VImage VImage::boolean( VImage right , VipsOperationBoolean boolean , VOption *o return( out ); } -VImage VImage::math2( VImage right , VipsOperationMath2 math2 , VOption *options ) +VImage VImage::math2( VImage right , VipsOperationMath2 math2 , VOption *options ) const { VImage out; @@ -116,7 +116,7 @@ VImage VImage::math2( VImage right , VipsOperationMath2 math2 , VOption *options return( out ); } -VImage VImage::complex2( VImage right , VipsOperationComplex2 cmplx , VOption *options ) +VImage VImage::complex2( VImage right , VipsOperationComplex2 cmplx , VOption *options ) const { VImage out; @@ -130,7 +130,7 @@ VImage VImage::complex2( VImage right , VipsOperationComplex2 cmplx , VOption *o return( out ); } -VImage VImage::complexform( VImage right , VOption *options ) +VImage VImage::complexform( VImage right , VOption *options ) const { VImage out; @@ -155,7 +155,7 @@ VImage VImage::sum( std::vector in , VOption *options ) return( out ); } -VImage VImage::invert( VOption *options ) +VImage VImage::invert( VOption *options ) const { VImage out; @@ -167,7 +167,7 @@ VImage VImage::invert( VOption *options ) return( out ); } -VImage VImage::linear( std::vector a , std::vector b , VOption *options ) +VImage VImage::linear( std::vector a , std::vector b , VOption *options ) const { VImage out; @@ -181,7 +181,7 @@ VImage VImage::linear( std::vector a , std::vector b , VOption * return( out ); } -VImage VImage::math( VipsOperationMath math , VOption *options ) +VImage VImage::math( VipsOperationMath math , VOption *options ) const { VImage out; @@ -194,7 +194,7 @@ VImage VImage::math( VipsOperationMath math , VOption *options ) return( out ); } -VImage VImage::abs( VOption *options ) +VImage VImage::abs( VOption *options ) const { VImage out; @@ -206,7 +206,7 @@ VImage VImage::abs( VOption *options ) return( out ); } -VImage VImage::sign( VOption *options ) +VImage VImage::sign( VOption *options ) const { VImage out; @@ -218,7 +218,7 @@ VImage VImage::sign( VOption *options ) return( out ); } -VImage VImage::round( VipsOperationRound round , VOption *options ) +VImage VImage::round( VipsOperationRound round , VOption *options ) const { VImage out; @@ -231,7 +231,7 @@ VImage VImage::round( VipsOperationRound round , VOption *options ) return( out ); } -VImage VImage::relational_const( VipsOperationRelational relational , std::vector c , VOption *options ) +VImage VImage::relational_const( VipsOperationRelational relational , std::vector c , VOption *options ) const { VImage out; @@ -245,7 +245,7 @@ VImage VImage::relational_const( VipsOperationRelational relational , std::vecto return( out ); } -VImage VImage::remainder_const( std::vector c , VOption *options ) +VImage VImage::remainder_const( std::vector c , VOption *options ) const { VImage out; @@ -258,7 +258,7 @@ VImage VImage::remainder_const( std::vector c , VOption *options ) return( out ); } -VImage VImage::boolean_const( VipsOperationBoolean boolean , std::vector c , VOption *options ) +VImage VImage::boolean_const( VipsOperationBoolean boolean , std::vector c , VOption *options ) const { VImage out; @@ -272,7 +272,7 @@ VImage VImage::boolean_const( VipsOperationBoolean boolean , std::vector return( out ); } -VImage VImage::math2_const( VipsOperationMath2 math2 , std::vector c , VOption *options ) +VImage VImage::math2_const( VipsOperationMath2 math2 , std::vector c , VOption *options ) const { VImage out; @@ -286,7 +286,7 @@ VImage VImage::math2_const( VipsOperationMath2 math2 , std::vector c , V return( out ); } -VImage VImage::complex( VipsOperationComplex cmplx , VOption *options ) +VImage VImage::complex( VipsOperationComplex cmplx , VOption *options ) const { VImage out; @@ -299,7 +299,7 @@ VImage VImage::complex( VipsOperationComplex cmplx , VOption *options ) return( out ); } -VImage VImage::complexget( VipsOperationComplexget get , VOption *options ) +VImage VImage::complexget( VipsOperationComplexget get , VOption *options ) const { VImage out; @@ -312,7 +312,7 @@ VImage VImage::complexget( VipsOperationComplexget get , VOption *options ) return( out ); } -double VImage::avg( VOption *options ) +double VImage::avg( VOption *options ) const { double out; @@ -324,7 +324,7 @@ double VImage::avg( VOption *options ) return( out ); } -double VImage::min( VOption *options ) +double VImage::min( VOption *options ) const { double out; @@ -336,7 +336,7 @@ double VImage::min( VOption *options ) return( out ); } -double VImage::max( VOption *options ) +double VImage::max( VOption *options ) const { double out; @@ -348,7 +348,7 @@ double VImage::max( VOption *options ) return( out ); } -double VImage::deviate( VOption *options ) +double VImage::deviate( VOption *options ) const { double out; @@ -360,7 +360,7 @@ double VImage::deviate( VOption *options ) return( out ); } -VImage VImage::stats( VOption *options ) +VImage VImage::stats( VOption *options ) const { VImage out; @@ -372,7 +372,7 @@ VImage VImage::stats( VOption *options ) return( out ); } -VImage VImage::hist_find( VOption *options ) +VImage VImage::hist_find( VOption *options ) const { VImage out; @@ -384,7 +384,7 @@ VImage VImage::hist_find( VOption *options ) return( out ); } -VImage VImage::hist_find_ndim( VOption *options ) +VImage VImage::hist_find_ndim( VOption *options ) const { VImage out; @@ -396,7 +396,7 @@ VImage VImage::hist_find_ndim( VOption *options ) return( out ); } -VImage VImage::hist_find_indexed( VImage index , VOption *options ) +VImage VImage::hist_find_indexed( VImage index , VOption *options ) const { VImage out; @@ -409,7 +409,7 @@ VImage VImage::hist_find_indexed( VImage index , VOption *options ) return( out ); } -VImage VImage::hough_line( VOption *options ) +VImage VImage::hough_line( VOption *options ) const { VImage out; @@ -421,7 +421,7 @@ VImage VImage::hough_line( VOption *options ) return( out ); } -VImage VImage::hough_circle( VOption *options ) +VImage VImage::hough_circle( VOption *options ) const { VImage out; @@ -433,7 +433,7 @@ VImage VImage::hough_circle( VOption *options ) return( out ); } -VImage VImage::project( VImage * rows , VOption *options ) +VImage VImage::project( VImage * rows , VOption *options ) const { VImage columns; @@ -446,7 +446,7 @@ VImage VImage::project( VImage * rows , VOption *options ) return( columns ); } -VImage VImage::profile( VImage * rows , VOption *options ) +VImage VImage::profile( VImage * rows , VOption *options ) const { VImage columns; @@ -459,7 +459,7 @@ VImage VImage::profile( VImage * rows , VOption *options ) return( columns ); } -VImage VImage::measure( int h , int v , VOption *options ) +VImage VImage::measure( int h , int v , VOption *options ) const { VImage out; @@ -473,7 +473,7 @@ VImage VImage::measure( int h , int v , VOption *options ) return( out ); } -std::vector VImage::getpoint( int x , int y , VOption *options ) +std::vector VImage::getpoint( int x , int y , VOption *options ) const { std::vector out_array; @@ -487,7 +487,7 @@ std::vector VImage::getpoint( int x , int y , VOption *options ) return( out_array ); } -int VImage::find_trim( int * top , int * width , int * height , VOption *options ) +int VImage::find_trim( int * top , int * width , int * height , VOption *options ) const { int left; @@ -502,7 +502,7 @@ int VImage::find_trim( int * top , int * width , int * height , VOption *options return( left ); } -VImage VImage::copy( VOption *options ) +VImage VImage::copy( VOption *options ) const { VImage out; @@ -514,7 +514,7 @@ VImage VImage::copy( VOption *options ) return( out ); } -VImage VImage::tilecache( VOption *options ) +VImage VImage::tilecache( VOption *options ) const { VImage out; @@ -526,7 +526,7 @@ VImage VImage::tilecache( VOption *options ) return( out ); } -VImage VImage::linecache( VOption *options ) +VImage VImage::linecache( VOption *options ) const { VImage out; @@ -538,7 +538,7 @@ VImage VImage::linecache( VOption *options ) return( out ); } -VImage VImage::sequential( VOption *options ) +VImage VImage::sequential( VOption *options ) const { VImage out; @@ -550,7 +550,7 @@ VImage VImage::sequential( VOption *options ) return( out ); } -VImage VImage::cache( VOption *options ) +VImage VImage::cache( VOption *options ) const { VImage out; @@ -562,7 +562,7 @@ VImage VImage::cache( VOption *options ) return( out ); } -VImage VImage::embed( int x , int y , int width , int height , VOption *options ) +VImage VImage::embed( int x , int y , int width , int height , VOption *options ) const { VImage out; @@ -578,7 +578,7 @@ VImage VImage::embed( int x , int y , int width , int height , VOption *options return( out ); } -VImage VImage::gravity( VipsCompassDirection direction , int width , int height , VOption *options ) +VImage VImage::gravity( VipsCompassDirection direction , int width , int height , VOption *options ) const { VImage out; @@ -593,7 +593,7 @@ VImage VImage::gravity( VipsCompassDirection direction , int width , int height return( out ); } -VImage VImage::flip( VipsDirection direction , VOption *options ) +VImage VImage::flip( VipsDirection direction , VOption *options ) const { VImage out; @@ -606,7 +606,7 @@ VImage VImage::flip( VipsDirection direction , VOption *options ) return( out ); } -VImage VImage::insert( VImage sub , int x , int y , VOption *options ) +VImage VImage::insert( VImage sub , int x , int y , VOption *options ) const { VImage out; @@ -621,7 +621,7 @@ VImage VImage::insert( VImage sub , int x , int y , VOption *options ) return( out ); } -VImage VImage::join( VImage in2 , VipsDirection direction , VOption *options ) +VImage VImage::join( VImage in2 , VipsDirection direction , VOption *options ) const { VImage out; @@ -647,7 +647,7 @@ VImage VImage::arrayjoin( std::vector in , VOption *options ) return( out ); } -VImage VImage::extract_area( int left , int top , int width , int height , VOption *options ) +VImage VImage::extract_area( int left , int top , int width , int height , VOption *options ) const { VImage out; @@ -663,7 +663,7 @@ VImage VImage::extract_area( int left , int top , int width , int height , VOpti return( out ); } -VImage VImage::smartcrop( int width , int height , VOption *options ) +VImage VImage::smartcrop( int width , int height , VOption *options ) const { VImage out; @@ -677,7 +677,7 @@ VImage VImage::smartcrop( int width , int height , VOption *options ) return( out ); } -VImage VImage::extract_band( int band , VOption *options ) +VImage VImage::extract_band( int band , VOption *options ) const { VImage out; @@ -702,7 +702,7 @@ VImage VImage::bandjoin( std::vector in , VOption *options ) return( out ); } -VImage VImage::bandjoin_const( std::vector c , VOption *options ) +VImage VImage::bandjoin_const( std::vector c , VOption *options ) const { VImage out; @@ -727,7 +727,7 @@ VImage VImage::bandrank( std::vector in , VOption *options ) return( out ); } -VImage VImage::bandmean( VOption *options ) +VImage VImage::bandmean( VOption *options ) const { VImage out; @@ -739,7 +739,7 @@ VImage VImage::bandmean( VOption *options ) return( out ); } -VImage VImage::bandbool( VipsOperationBoolean boolean , VOption *options ) +VImage VImage::bandbool( VipsOperationBoolean boolean , VOption *options ) const { VImage out; @@ -752,7 +752,7 @@ VImage VImage::bandbool( VipsOperationBoolean boolean , VOption *options ) return( out ); } -VImage VImage::replicate( int across , int down , VOption *options ) +VImage VImage::replicate( int across , int down , VOption *options ) const { VImage out; @@ -766,7 +766,7 @@ VImage VImage::replicate( int across , int down , VOption *options ) return( out ); } -VImage VImage::cast( VipsBandFormat format , VOption *options ) +VImage VImage::cast( VipsBandFormat format , VOption *options ) const { VImage out; @@ -779,7 +779,7 @@ VImage VImage::cast( VipsBandFormat format , VOption *options ) return( out ); } -VImage VImage::rot( VipsAngle angle , VOption *options ) +VImage VImage::rot( VipsAngle angle , VOption *options ) const { VImage out; @@ -792,7 +792,7 @@ VImage VImage::rot( VipsAngle angle , VOption *options ) return( out ); } -VImage VImage::rot45( VOption *options ) +VImage VImage::rot45( VOption *options ) const { VImage out; @@ -804,7 +804,7 @@ VImage VImage::rot45( VOption *options ) return( out ); } -VImage VImage::autorot( VOption *options ) +VImage VImage::autorot( VOption *options ) const { VImage out; @@ -816,7 +816,7 @@ VImage VImage::autorot( VOption *options ) return( out ); } -VImage VImage::ifthenelse( VImage in1 , VImage in2 , VOption *options ) +VImage VImage::ifthenelse( VImage in1 , VImage in2 , VOption *options ) const { VImage out; @@ -830,7 +830,7 @@ VImage VImage::ifthenelse( VImage in1 , VImage in2 , VOption *options ) return( out ); } -VImage VImage::recomb( VImage m , VOption *options ) +VImage VImage::recomb( VImage m , VOption *options ) const { VImage out; @@ -843,7 +843,7 @@ VImage VImage::recomb( VImage m , VOption *options ) return( out ); } -VImage VImage::bandfold( VOption *options ) +VImage VImage::bandfold( VOption *options ) const { VImage out; @@ -855,7 +855,7 @@ VImage VImage::bandfold( VOption *options ) return( out ); } -VImage VImage::bandunfold( VOption *options ) +VImage VImage::bandunfold( VOption *options ) const { VImage out; @@ -867,7 +867,7 @@ VImage VImage::bandunfold( VOption *options ) return( out ); } -VImage VImage::flatten( VOption *options ) +VImage VImage::flatten( VOption *options ) const { VImage out; @@ -879,7 +879,7 @@ VImage VImage::flatten( VOption *options ) return( out ); } -VImage VImage::premultiply( VOption *options ) +VImage VImage::premultiply( VOption *options ) const { VImage out; @@ -891,7 +891,7 @@ VImage VImage::premultiply( VOption *options ) return( out ); } -VImage VImage::unpremultiply( VOption *options ) +VImage VImage::unpremultiply( VOption *options ) const { VImage out; @@ -903,7 +903,7 @@ VImage VImage::unpremultiply( VOption *options ) return( out ); } -VImage VImage::grid( int tile_height , int across , int down , VOption *options ) +VImage VImage::grid( int tile_height , int across , int down , VOption *options ) const { VImage out; @@ -918,7 +918,19 @@ VImage VImage::grid( int tile_height , int across , int down , VOption *options return( out ); } -VImage VImage::scale( VOption *options ) +VImage VImage::transpose3d( VOption *options ) const +{ + VImage out; + + call( "transpose3d" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::scale( VOption *options ) const { VImage out; @@ -930,7 +942,7 @@ VImage VImage::scale( VOption *options ) return( out ); } -VImage VImage::wrap( VOption *options ) +VImage VImage::wrap( VOption *options ) const { VImage out; @@ -942,7 +954,7 @@ VImage VImage::wrap( VOption *options ) return( out ); } -VImage VImage::zoom( int xfac , int yfac , VOption *options ) +VImage VImage::zoom( int xfac , int yfac , VOption *options ) const { VImage out; @@ -956,7 +968,7 @@ VImage VImage::zoom( int xfac , int yfac , VOption *options ) return( out ); } -VImage VImage::subsample( int xfac , int yfac , VOption *options ) +VImage VImage::subsample( int xfac , int yfac , VOption *options ) const { VImage out; @@ -970,7 +982,7 @@ VImage VImage::subsample( int xfac , int yfac , VOption *options ) return( out ); } -VImage VImage::msb( VOption *options ) +VImage VImage::msb( VOption *options ) const { VImage out; @@ -982,7 +994,7 @@ VImage VImage::msb( VOption *options ) return( out ); } -VImage VImage::byteswap( VOption *options ) +VImage VImage::byteswap( VOption *options ) const { VImage out; @@ -994,7 +1006,7 @@ VImage VImage::byteswap( VOption *options ) return( out ); } -VImage VImage::falsecolour( VOption *options ) +VImage VImage::falsecolour( VOption *options ) const { VImage out; @@ -1006,7 +1018,7 @@ VImage VImage::falsecolour( VOption *options ) return( out ); } -VImage VImage::gamma( VOption *options ) +VImage VImage::gamma( VOption *options ) const { VImage out; @@ -1031,6 +1043,20 @@ VImage VImage::composite( std::vector in , std::vector mode , VOpti return( out ); } +VImage VImage::composite2( VImage overlay , VipsBlendMode mode , VOption *options ) const +{ + VImage out; + + call( "composite2" , + (options ? options : VImage::option()) -> + set( "base", *this ) -> + set( "overlay", overlay ) -> + set( "out", &out ) -> + set( "mode", mode ) ); + + return( out ); +} + VImage VImage::black( int width , int height , VOption *options ) { VImage out; @@ -1318,7 +1344,7 @@ VImage VImage::mask_fractal( int width , int height , double fractal_dimension , return( out ); } -VImage VImage::buildlut( VOption *options ) +VImage VImage::buildlut( VOption *options ) const { VImage out; @@ -1330,7 +1356,7 @@ VImage VImage::buildlut( VOption *options ) return( out ); } -VImage VImage::invertlut( VOption *options ) +VImage VImage::invertlut( VOption *options ) const { VImage out; @@ -1731,7 +1757,7 @@ VImage VImage::openexrload( char * filename , VOption *options ) return( out ); } -void VImage::csvsave( char * filename , VOption *options ) +void VImage::csvsave( char * filename , VOption *options ) const { call( "csvsave" , (options ? options : VImage::option()) -> @@ -1739,7 +1765,7 @@ void VImage::csvsave( char * filename , VOption *options ) set( "filename", filename ) ); } -void VImage::matrixsave( char * filename , VOption *options ) +void VImage::matrixsave( char * filename , VOption *options ) const { call( "matrixsave" , (options ? options : VImage::option()) -> @@ -1747,14 +1773,14 @@ void VImage::matrixsave( char * filename , VOption *options ) set( "filename", filename ) ); } -void VImage::matrixprint( VOption *options ) +void VImage::matrixprint( VOption *options ) const { call( "matrixprint" , (options ? options : VImage::option()) -> set( "in", *this ) ); } -void VImage::rawsave( char * filename , VOption *options ) +void VImage::rawsave( char * filename , VOption *options ) const { call( "rawsave" , (options ? options : VImage::option()) -> @@ -1762,7 +1788,7 @@ void VImage::rawsave( char * filename , VOption *options ) set( "filename", filename ) ); } -void VImage::rawsave_fd( int fd , VOption *options ) +void VImage::rawsave_fd( int fd , VOption *options ) const { call( "rawsave_fd" , (options ? options : VImage::option()) -> @@ -1770,7 +1796,7 @@ void VImage::rawsave_fd( int fd , VOption *options ) set( "fd", fd ) ); } -void VImage::vipssave( char * filename , VOption *options ) +void VImage::vipssave( char * filename , VOption *options ) const { call( "vipssave" , (options ? options : VImage::option()) -> @@ -1778,7 +1804,7 @@ void VImage::vipssave( char * filename , VOption *options ) set( "filename", filename ) ); } -void VImage::ppmsave( char * filename , VOption *options ) +void VImage::ppmsave( char * filename , VOption *options ) const { call( "ppmsave" , (options ? options : VImage::option()) -> @@ -1786,7 +1812,7 @@ void VImage::ppmsave( char * filename , VOption *options ) set( "filename", filename ) ); } -void VImage::radsave( char * filename , VOption *options ) +void VImage::radsave( char * filename , VOption *options ) const { call( "radsave" , (options ? options : VImage::option()) -> @@ -1794,7 +1820,7 @@ void VImage::radsave( char * filename , VOption *options ) set( "filename", filename ) ); } -VipsBlob * VImage::radsave_buffer( VOption *options ) +VipsBlob * VImage::radsave_buffer( VOption *options ) const { VipsBlob * buffer; @@ -1806,7 +1832,7 @@ VipsBlob * VImage::radsave_buffer( VOption *options ) return( buffer ); } -void VImage::dzsave( char * filename , VOption *options ) +void VImage::dzsave( char * filename , VOption *options ) const { call( "dzsave" , (options ? options : VImage::option()) -> @@ -1814,7 +1840,7 @@ void VImage::dzsave( char * filename , VOption *options ) set( "filename", filename ) ); } -VipsBlob * VImage::dzsave_buffer( VOption *options ) +VipsBlob * VImage::dzsave_buffer( VOption *options ) const { VipsBlob * buffer; @@ -1826,7 +1852,7 @@ VipsBlob * VImage::dzsave_buffer( VOption *options ) return( buffer ); } -void VImage::pngsave( char * filename , VOption *options ) +void VImage::pngsave( char * filename , VOption *options ) const { call( "pngsave" , (options ? options : VImage::option()) -> @@ -1834,7 +1860,7 @@ void VImage::pngsave( char * filename , VOption *options ) set( "filename", filename ) ); } -VipsBlob * VImage::pngsave_buffer( VOption *options ) +VipsBlob * VImage::pngsave_buffer( VOption *options ) const { VipsBlob * buffer; @@ -1846,7 +1872,7 @@ VipsBlob * VImage::pngsave_buffer( VOption *options ) return( buffer ); } -void VImage::jpegsave( char * filename , VOption *options ) +void VImage::jpegsave( char * filename , VOption *options ) const { call( "jpegsave" , (options ? options : VImage::option()) -> @@ -1854,7 +1880,7 @@ void VImage::jpegsave( char * filename , VOption *options ) set( "filename", filename ) ); } -VipsBlob * VImage::jpegsave_buffer( VOption *options ) +VipsBlob * VImage::jpegsave_buffer( VOption *options ) const { VipsBlob * buffer; @@ -1866,14 +1892,14 @@ VipsBlob * VImage::jpegsave_buffer( VOption *options ) return( buffer ); } -void VImage::jpegsave_mime( VOption *options ) +void VImage::jpegsave_mime( VOption *options ) const { call( "jpegsave_mime" , (options ? options : VImage::option()) -> set( "in", *this ) ); } -void VImage::webpsave( char * filename , VOption *options ) +void VImage::webpsave( char * filename , VOption *options ) const { call( "webpsave" , (options ? options : VImage::option()) -> @@ -1881,7 +1907,7 @@ void VImage::webpsave( char * filename , VOption *options ) set( "filename", filename ) ); } -VipsBlob * VImage::webpsave_buffer( VOption *options ) +VipsBlob * VImage::webpsave_buffer( VOption *options ) const { VipsBlob * buffer; @@ -1893,7 +1919,7 @@ VipsBlob * VImage::webpsave_buffer( VOption *options ) return( buffer ); } -void VImage::tiffsave( char * filename , VOption *options ) +void VImage::tiffsave( char * filename , VOption *options ) const { call( "tiffsave" , (options ? options : VImage::option()) -> @@ -1901,7 +1927,7 @@ void VImage::tiffsave( char * filename , VOption *options ) set( "filename", filename ) ); } -VipsBlob * VImage::tiffsave_buffer( VOption *options ) +VipsBlob * VImage::tiffsave_buffer( VOption *options ) const { VipsBlob * buffer; @@ -1913,7 +1939,27 @@ VipsBlob * VImage::tiffsave_buffer( VOption *options ) return( buffer ); } -void VImage::fitssave( char * filename , VOption *options ) +void VImage::magicksave( char * filename , VOption *options ) const +{ + call( "magicksave" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "filename", filename ) ); +} + +VipsBlob * VImage::magicksave_buffer( VOption *options ) const +{ + VipsBlob * buffer; + + call( "magicksave_buffer" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "buffer", &buffer ) ); + + return( buffer ); +} + +void VImage::fitssave( char * filename , VOption *options ) const { call( "fitssave" , (options ? options : VImage::option()) -> @@ -1947,7 +1993,7 @@ VImage VImage::thumbnail_buffer( VipsBlob * buffer , int width , VOption *option return( out ); } -VImage VImage::thumbnail_image( int width , VOption *options ) +VImage VImage::thumbnail_image( int width , VOption *options ) const { VImage out; @@ -1960,7 +2006,7 @@ VImage VImage::thumbnail_image( int width , VOption *options ) return( out ); } -VImage VImage::mapim( VImage index , VOption *options ) +VImage VImage::mapim( VImage index , VOption *options ) const { VImage out; @@ -1973,7 +2019,7 @@ VImage VImage::mapim( VImage index , VOption *options ) return( out ); } -VImage VImage::shrink( double hshrink , double vshrink , VOption *options ) +VImage VImage::shrink( double hshrink , double vshrink , VOption *options ) const { VImage out; @@ -1987,7 +2033,7 @@ VImage VImage::shrink( double hshrink , double vshrink , VOption *options ) return( out ); } -VImage VImage::shrinkh( int hshrink , VOption *options ) +VImage VImage::shrinkh( int hshrink , VOption *options ) const { VImage out; @@ -2000,7 +2046,7 @@ VImage VImage::shrinkh( int hshrink , VOption *options ) return( out ); } -VImage VImage::shrinkv( int vshrink , VOption *options ) +VImage VImage::shrinkv( int vshrink , VOption *options ) const { VImage out; @@ -2013,7 +2059,7 @@ VImage VImage::shrinkv( int vshrink , VOption *options ) return( out ); } -VImage VImage::reduceh( double hshrink , VOption *options ) +VImage VImage::reduceh( double hshrink , VOption *options ) const { VImage out; @@ -2026,7 +2072,7 @@ VImage VImage::reduceh( double hshrink , VOption *options ) return( out ); } -VImage VImage::reducev( double vshrink , VOption *options ) +VImage VImage::reducev( double vshrink , VOption *options ) const { VImage out; @@ -2039,7 +2085,7 @@ VImage VImage::reducev( double vshrink , VOption *options ) return( out ); } -VImage VImage::reduce( double hshrink , double vshrink , VOption *options ) +VImage VImage::reduce( double hshrink , double vshrink , VOption *options ) const { VImage out; @@ -2053,7 +2099,7 @@ VImage VImage::reduce( double hshrink , double vshrink , VOption *options ) return( out ); } -VImage VImage::quadratic( VImage coeff , VOption *options ) +VImage VImage::quadratic( VImage coeff , VOption *options ) const { VImage out; @@ -2066,7 +2112,7 @@ VImage VImage::quadratic( VImage coeff , VOption *options ) return( out ); } -VImage VImage::affine( std::vector matrix , VOption *options ) +VImage VImage::affine( std::vector matrix , VOption *options ) const { VImage out; @@ -2079,7 +2125,7 @@ VImage VImage::affine( std::vector matrix , VOption *options ) return( out ); } -VImage VImage::similarity( VOption *options ) +VImage VImage::similarity( VOption *options ) const { VImage out; @@ -2091,7 +2137,20 @@ VImage VImage::similarity( VOption *options ) return( out ); } -VImage VImage::resize( double scale , VOption *options ) +VImage VImage::rotate( double angle , VOption *options ) const +{ + VImage out; + + call( "rotate" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) -> + set( "angle", angle ) ); + + return( out ); +} + +VImage VImage::resize( double scale , VOption *options ) const { VImage out; @@ -2104,7 +2163,7 @@ VImage VImage::resize( double scale , VOption *options ) return( out ); } -VImage VImage::colourspace( VipsInterpretation space , VOption *options ) +VImage VImage::colourspace( VipsInterpretation space , VOption *options ) const { VImage out; @@ -2117,7 +2176,7 @@ VImage VImage::colourspace( VipsInterpretation space , VOption *options ) return( out ); } -VImage VImage::Lab2XYZ( VOption *options ) +VImage VImage::Lab2XYZ( VOption *options ) const { VImage out; @@ -2129,7 +2188,7 @@ VImage VImage::Lab2XYZ( VOption *options ) return( out ); } -VImage VImage::XYZ2Lab( VOption *options ) +VImage VImage::XYZ2Lab( VOption *options ) const { VImage out; @@ -2141,7 +2200,7 @@ VImage VImage::XYZ2Lab( VOption *options ) return( out ); } -VImage VImage::Lab2LCh( VOption *options ) +VImage VImage::Lab2LCh( VOption *options ) const { VImage out; @@ -2153,7 +2212,7 @@ VImage VImage::Lab2LCh( VOption *options ) return( out ); } -VImage VImage::LCh2Lab( VOption *options ) +VImage VImage::LCh2Lab( VOption *options ) const { VImage out; @@ -2165,7 +2224,7 @@ VImage VImage::LCh2Lab( VOption *options ) return( out ); } -VImage VImage::LCh2CMC( VOption *options ) +VImage VImage::LCh2CMC( VOption *options ) const { VImage out; @@ -2177,7 +2236,7 @@ VImage VImage::LCh2CMC( VOption *options ) return( out ); } -VImage VImage::CMC2LCh( VOption *options ) +VImage VImage::CMC2LCh( VOption *options ) const { VImage out; @@ -2189,7 +2248,7 @@ VImage VImage::CMC2LCh( VOption *options ) return( out ); } -VImage VImage::XYZ2Yxy( VOption *options ) +VImage VImage::XYZ2Yxy( VOption *options ) const { VImage out; @@ -2201,7 +2260,7 @@ VImage VImage::XYZ2Yxy( VOption *options ) return( out ); } -VImage VImage::Yxy2XYZ( VOption *options ) +VImage VImage::Yxy2XYZ( VOption *options ) const { VImage out; @@ -2213,7 +2272,7 @@ VImage VImage::Yxy2XYZ( VOption *options ) return( out ); } -VImage VImage::scRGB2XYZ( VOption *options ) +VImage VImage::scRGB2XYZ( VOption *options ) const { VImage out; @@ -2225,7 +2284,7 @@ VImage VImage::scRGB2XYZ( VOption *options ) return( out ); } -VImage VImage::XYZ2scRGB( VOption *options ) +VImage VImage::XYZ2scRGB( VOption *options ) const { VImage out; @@ -2237,7 +2296,7 @@ VImage VImage::XYZ2scRGB( VOption *options ) return( out ); } -VImage VImage::LabQ2Lab( VOption *options ) +VImage VImage::LabQ2Lab( VOption *options ) const { VImage out; @@ -2249,7 +2308,7 @@ VImage VImage::LabQ2Lab( VOption *options ) return( out ); } -VImage VImage::Lab2LabQ( VOption *options ) +VImage VImage::Lab2LabQ( VOption *options ) const { VImage out; @@ -2261,7 +2320,7 @@ VImage VImage::Lab2LabQ( VOption *options ) return( out ); } -VImage VImage::LabQ2LabS( VOption *options ) +VImage VImage::LabQ2LabS( VOption *options ) const { VImage out; @@ -2273,7 +2332,7 @@ VImage VImage::LabQ2LabS( VOption *options ) return( out ); } -VImage VImage::LabS2LabQ( VOption *options ) +VImage VImage::LabS2LabQ( VOption *options ) const { VImage out; @@ -2285,7 +2344,7 @@ VImage VImage::LabS2LabQ( VOption *options ) return( out ); } -VImage VImage::LabS2Lab( VOption *options ) +VImage VImage::LabS2Lab( VOption *options ) const { VImage out; @@ -2297,7 +2356,7 @@ VImage VImage::LabS2Lab( VOption *options ) return( out ); } -VImage VImage::Lab2LabS( VOption *options ) +VImage VImage::Lab2LabS( VOption *options ) const { VImage out; @@ -2309,7 +2368,7 @@ VImage VImage::Lab2LabS( VOption *options ) return( out ); } -VImage VImage::rad2float( VOption *options ) +VImage VImage::rad2float( VOption *options ) const { VImage out; @@ -2321,7 +2380,7 @@ VImage VImage::rad2float( VOption *options ) return( out ); } -VImage VImage::float2rad( VOption *options ) +VImage VImage::float2rad( VOption *options ) const { VImage out; @@ -2333,7 +2392,7 @@ VImage VImage::float2rad( VOption *options ) return( out ); } -VImage VImage::LabQ2sRGB( VOption *options ) +VImage VImage::LabQ2sRGB( VOption *options ) const { VImage out; @@ -2345,7 +2404,7 @@ VImage VImage::LabQ2sRGB( VOption *options ) return( out ); } -VImage VImage::sRGB2HSV( VOption *options ) +VImage VImage::sRGB2HSV( VOption *options ) const { VImage out; @@ -2357,7 +2416,7 @@ VImage VImage::sRGB2HSV( VOption *options ) return( out ); } -VImage VImage::HSV2sRGB( VOption *options ) +VImage VImage::HSV2sRGB( VOption *options ) const { VImage out; @@ -2369,7 +2428,7 @@ VImage VImage::HSV2sRGB( VOption *options ) return( out ); } -VImage VImage::icc_import( VOption *options ) +VImage VImage::icc_import( VOption *options ) const { VImage out; @@ -2381,7 +2440,7 @@ VImage VImage::icc_import( VOption *options ) return( out ); } -VImage VImage::icc_export( VOption *options ) +VImage VImage::icc_export( VOption *options ) const { VImage out; @@ -2393,7 +2452,7 @@ VImage VImage::icc_export( VOption *options ) return( out ); } -VImage VImage::icc_transform( char * output_profile , VOption *options ) +VImage VImage::icc_transform( char * output_profile , VOption *options ) const { VImage out; @@ -2406,7 +2465,7 @@ VImage VImage::icc_transform( char * output_profile , VOption *options ) return( out ); } -VImage VImage::dE76( VImage right , VOption *options ) +VImage VImage::dE76( VImage right , VOption *options ) const { VImage out; @@ -2419,7 +2478,7 @@ VImage VImage::dE76( VImage right , VOption *options ) return( out ); } -VImage VImage::dE00( VImage right , VOption *options ) +VImage VImage::dE00( VImage right , VOption *options ) const { VImage out; @@ -2432,7 +2491,7 @@ VImage VImage::dE00( VImage right , VOption *options ) return( out ); } -VImage VImage::dECMC( VImage right , VOption *options ) +VImage VImage::dECMC( VImage right , VOption *options ) const { VImage out; @@ -2445,7 +2504,7 @@ VImage VImage::dECMC( VImage right , VOption *options ) return( out ); } -VImage VImage::sRGB2scRGB( VOption *options ) +VImage VImage::sRGB2scRGB( VOption *options ) const { VImage out; @@ -2457,7 +2516,7 @@ VImage VImage::sRGB2scRGB( VOption *options ) return( out ); } -VImage VImage::scRGB2BW( VOption *options ) +VImage VImage::scRGB2BW( VOption *options ) const { VImage out; @@ -2469,7 +2528,7 @@ VImage VImage::scRGB2BW( VOption *options ) return( out ); } -VImage VImage::scRGB2sRGB( VOption *options ) +VImage VImage::scRGB2sRGB( VOption *options ) const { VImage out; @@ -2481,7 +2540,7 @@ VImage VImage::scRGB2sRGB( VOption *options ) return( out ); } -VImage VImage::maplut( VImage lut , VOption *options ) +VImage VImage::maplut( VImage lut , VOption *options ) const { VImage out; @@ -2494,7 +2553,7 @@ VImage VImage::maplut( VImage lut , VOption *options ) return( out ); } -int VImage::percent( double percent , VOption *options ) +int VImage::percent( double percent , VOption *options ) const { int threshold; @@ -2507,7 +2566,7 @@ int VImage::percent( double percent , VOption *options ) return( threshold ); } -VImage VImage::stdif( int width , int height , VOption *options ) +VImage VImage::stdif( int width , int height , VOption *options ) const { VImage out; @@ -2521,7 +2580,7 @@ VImage VImage::stdif( int width , int height , VOption *options ) return( out ); } -VImage VImage::hist_cum( VOption *options ) +VImage VImage::hist_cum( VOption *options ) const { VImage out; @@ -2533,7 +2592,7 @@ VImage VImage::hist_cum( VOption *options ) return( out ); } -VImage VImage::hist_match( VImage ref , VOption *options ) +VImage VImage::hist_match( VImage ref , VOption *options ) const { VImage out; @@ -2546,7 +2605,7 @@ VImage VImage::hist_match( VImage ref , VOption *options ) return( out ); } -VImage VImage::hist_norm( VOption *options ) +VImage VImage::hist_norm( VOption *options ) const { VImage out; @@ -2558,7 +2617,7 @@ VImage VImage::hist_norm( VOption *options ) return( out ); } -VImage VImage::hist_equal( VOption *options ) +VImage VImage::hist_equal( VOption *options ) const { VImage out; @@ -2570,7 +2629,7 @@ VImage VImage::hist_equal( VOption *options ) return( out ); } -VImage VImage::hist_plot( VOption *options ) +VImage VImage::hist_plot( VOption *options ) const { VImage out; @@ -2582,7 +2641,7 @@ VImage VImage::hist_plot( VOption *options ) return( out ); } -VImage VImage::hist_local( int width , int height , VOption *options ) +VImage VImage::hist_local( int width , int height , VOption *options ) const { VImage out; @@ -2596,7 +2655,7 @@ VImage VImage::hist_local( int width , int height , VOption *options ) return( out ); } -bool VImage::hist_ismonotonic( VOption *options ) +bool VImage::hist_ismonotonic( VOption *options ) const { bool monotonic; @@ -2608,7 +2667,7 @@ bool VImage::hist_ismonotonic( VOption *options ) return( monotonic ); } -double VImage::hist_entropy( VOption *options ) +double VImage::hist_entropy( VOption *options ) const { double out; @@ -2620,7 +2679,7 @@ double VImage::hist_entropy( VOption *options ) return( out ); } -VImage VImage::conv( VImage mask , VOption *options ) +VImage VImage::conv( VImage mask , VOption *options ) const { VImage out; @@ -2633,7 +2692,7 @@ VImage VImage::conv( VImage mask , VOption *options ) return( out ); } -VImage VImage::conva( VImage mask , VOption *options ) +VImage VImage::conva( VImage mask , VOption *options ) const { VImage out; @@ -2646,7 +2705,7 @@ VImage VImage::conva( VImage mask , VOption *options ) return( out ); } -VImage VImage::convf( VImage mask , VOption *options ) +VImage VImage::convf( VImage mask , VOption *options ) const { VImage out; @@ -2659,7 +2718,7 @@ VImage VImage::convf( VImage mask , VOption *options ) return( out ); } -VImage VImage::convi( VImage mask , VOption *options ) +VImage VImage::convi( VImage mask , VOption *options ) const { VImage out; @@ -2672,7 +2731,7 @@ VImage VImage::convi( VImage mask , VOption *options ) return( out ); } -VImage VImage::compass( VImage mask , VOption *options ) +VImage VImage::compass( VImage mask , VOption *options ) const { VImage out; @@ -2685,7 +2744,7 @@ VImage VImage::compass( VImage mask , VOption *options ) return( out ); } -VImage VImage::convsep( VImage mask , VOption *options ) +VImage VImage::convsep( VImage mask , VOption *options ) const { VImage out; @@ -2698,7 +2757,7 @@ VImage VImage::convsep( VImage mask , VOption *options ) return( out ); } -VImage VImage::convasep( VImage mask , VOption *options ) +VImage VImage::convasep( VImage mask , VOption *options ) const { VImage out; @@ -2711,7 +2770,7 @@ VImage VImage::convasep( VImage mask , VOption *options ) return( out ); } -VImage VImage::fastcor( VImage ref , VOption *options ) +VImage VImage::fastcor( VImage ref , VOption *options ) const { VImage out; @@ -2724,7 +2783,7 @@ VImage VImage::fastcor( VImage ref , VOption *options ) return( out ); } -VImage VImage::spcor( VImage ref , VOption *options ) +VImage VImage::spcor( VImage ref , VOption *options ) const { VImage out; @@ -2737,7 +2796,7 @@ VImage VImage::spcor( VImage ref , VOption *options ) return( out ); } -VImage VImage::sharpen( VOption *options ) +VImage VImage::sharpen( VOption *options ) const { VImage out; @@ -2749,7 +2808,7 @@ VImage VImage::sharpen( VOption *options ) return( out ); } -VImage VImage::gaussblur( double sigma , VOption *options ) +VImage VImage::gaussblur( double sigma , VOption *options ) const { VImage out; @@ -2762,7 +2821,31 @@ VImage VImage::gaussblur( double sigma , VOption *options ) return( out ); } -VImage VImage::fwfft( VOption *options ) +VImage VImage::canny( VOption *options ) const +{ + VImage out; + + call( "canny" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::sobel( VOption *options ) const +{ + VImage out; + + call( "sobel" , + (options ? options : VImage::option()) -> + set( "in", *this ) -> + set( "out", &out ) ); + + return( out ); +} + +VImage VImage::fwfft( VOption *options ) const { VImage out; @@ -2774,7 +2857,7 @@ VImage VImage::fwfft( VOption *options ) return( out ); } -VImage VImage::invfft( VOption *options ) +VImage VImage::invfft( VOption *options ) const { VImage out; @@ -2786,7 +2869,7 @@ VImage VImage::invfft( VOption *options ) return( out ); } -VImage VImage::freqmult( VImage mask , VOption *options ) +VImage VImage::freqmult( VImage mask , VOption *options ) const { VImage out; @@ -2799,7 +2882,7 @@ VImage VImage::freqmult( VImage mask , VOption *options ) return( out ); } -VImage VImage::spectrum( VOption *options ) +VImage VImage::spectrum( VOption *options ) const { VImage out; @@ -2811,7 +2894,7 @@ VImage VImage::spectrum( VOption *options ) return( out ); } -VImage VImage::phasecor( VImage in2 , VOption *options ) +VImage VImage::phasecor( VImage in2 , VOption *options ) const { VImage out; @@ -2824,7 +2907,7 @@ VImage VImage::phasecor( VImage in2 , VOption *options ) return( out ); } -VImage VImage::morph( VImage mask , VipsOperationMorphology morph , VOption *options ) +VImage VImage::morph( VImage mask , VipsOperationMorphology morph , VOption *options ) const { VImage out; @@ -2838,7 +2921,7 @@ VImage VImage::morph( VImage mask , VipsOperationMorphology morph , VOption *opt return( out ); } -VImage VImage::rank( int width , int height , int index , VOption *options ) +VImage VImage::rank( int width , int height , int index , VOption *options ) const { VImage out; @@ -2853,7 +2936,7 @@ VImage VImage::rank( int width , int height , int index , VOption *options ) return( out ); } -double VImage::countlines( VipsDirection direction , VOption *options ) +double VImage::countlines( VipsDirection direction , VOption *options ) const { double nolines; @@ -2866,7 +2949,7 @@ double VImage::countlines( VipsDirection direction , VOption *options ) return( nolines ); } -VImage VImage::labelregions( VOption *options ) +VImage VImage::labelregions( VOption *options ) const { VImage mask; @@ -2878,7 +2961,7 @@ VImage VImage::labelregions( VOption *options ) return( mask ); } -VImage VImage::fill_nearest( VOption *options ) +VImage VImage::fill_nearest( VOption *options ) const { VImage out; @@ -2890,7 +2973,7 @@ VImage VImage::fill_nearest( VOption *options ) return( out ); } -void VImage::draw_rect( std::vector ink , int left , int top , int width , int height , VOption *options ) +void VImage::draw_rect( std::vector ink , int left , int top , int width , int height , VOption *options ) const { call( "draw_rect" , (options ? options : VImage::option()) -> @@ -2902,7 +2985,7 @@ void VImage::draw_rect( std::vector ink , int left , int top , int width set( "height", height ) ); } -void VImage::draw_mask( std::vector ink , VImage mask , int x , int y , VOption *options ) +void VImage::draw_mask( std::vector ink , VImage mask , int x , int y , VOption *options ) const { call( "draw_mask" , (options ? options : VImage::option()) -> @@ -2913,7 +2996,7 @@ void VImage::draw_mask( std::vector ink , VImage mask , int x , int y , set( "y", y ) ); } -void VImage::draw_line( std::vector ink , int x1 , int y1 , int x2 , int y2 , VOption *options ) +void VImage::draw_line( std::vector ink , int x1 , int y1 , int x2 , int y2 , VOption *options ) const { call( "draw_line" , (options ? options : VImage::option()) -> @@ -2925,7 +3008,7 @@ void VImage::draw_line( std::vector ink , int x1 , int y1 , int x2 , int set( "y2", y2 ) ); } -void VImage::draw_circle( std::vector ink , int cx , int cy , int radius , VOption *options ) +void VImage::draw_circle( std::vector ink , int cx , int cy , int radius , VOption *options ) const { call( "draw_circle" , (options ? options : VImage::option()) -> @@ -2936,7 +3019,7 @@ void VImage::draw_circle( std::vector ink , int cx , int cy , int radius set( "radius", radius ) ); } -void VImage::draw_flood( std::vector ink , int x , int y , VOption *options ) +void VImage::draw_flood( std::vector ink , int x , int y , VOption *options ) const { call( "draw_flood" , (options ? options : VImage::option()) -> @@ -2946,7 +3029,7 @@ void VImage::draw_flood( std::vector ink , int x , int y , VOption *opti set( "y", y ) ); } -void VImage::draw_image( VImage sub , int x , int y , VOption *options ) +void VImage::draw_image( VImage sub , int x , int y , VOption *options ) const { call( "draw_image" , (options ? options : VImage::option()) -> @@ -2956,7 +3039,7 @@ void VImage::draw_image( VImage sub , int x , int y , VOption *options ) set( "y", y ) ); } -void VImage::draw_smudge( int left , int top , int width , int height , VOption *options ) +void VImage::draw_smudge( int left , int top , int width , int height , VOption *options ) const { call( "draw_smudge" , (options ? options : VImage::option()) -> @@ -2967,7 +3050,7 @@ void VImage::draw_smudge( int left , int top , int width , int height , VOption set( "height", height ) ); } -VImage VImage::merge( VImage sec , VipsDirection direction , int dx , int dy , VOption *options ) +VImage VImage::merge( VImage sec , VipsDirection direction , int dx , int dy , VOption *options ) const { VImage out; @@ -2983,7 +3066,7 @@ VImage VImage::merge( VImage sec , VipsDirection direction , int dx , int dy , V return( out ); } -VImage VImage::mosaic( VImage sec , VipsDirection direction , int xref , int yref , int xsec , int ysec , VOption *options ) +VImage VImage::mosaic( VImage sec , VipsDirection direction , int xref , int yref , int xsec , int ysec , VOption *options ) const { VImage out; @@ -3001,7 +3084,7 @@ VImage VImage::mosaic( VImage sec , VipsDirection direction , int xref , int yre return( out ); } -VImage VImage::mosaic1( VImage sec , VipsDirection direction , int xr1 , int yr1 , int xs1 , int ys1 , int xr2 , int yr2 , int xs2 , int ys2 , VOption *options ) +VImage VImage::mosaic1( VImage sec , VipsDirection direction , int xr1 , int yr1 , int xs1 , int ys1 , int xr2 , int yr2 , int xs2 , int ys2 , VOption *options ) const { VImage out; @@ -3023,7 +3106,7 @@ VImage VImage::mosaic1( VImage sec , VipsDirection direction , int xr1 , int yr1 return( out ); } -VImage VImage::match( VImage sec , int xr1 , int yr1 , int xs1 , int ys1 , int xr2 , int yr2 , int xs2 , int ys2 , VOption *options ) +VImage VImage::match( VImage sec , int xr1 , int yr1 , int xs1 , int ys1 , int xr2 , int yr2 , int xs2 , int ys2 , VOption *options ) const { VImage out; @@ -3044,7 +3127,7 @@ VImage VImage::match( VImage sec , int xr1 , int yr1 , int xs1 , int ys1 , int x return( out ); } -VImage VImage::globalbalance( VOption *options ) +VImage VImage::globalbalance( VOption *options ) const { VImage out; diff --git a/src/pipeline.cc b/src/pipeline.cc index dedb376f..a1e414fc 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -894,10 +894,6 @@ class PipelineWorker : public Nan::AsyncWorker { if (baton->tiffCompression == VIPS_FOREIGN_TIFF_COMPRESSION_JPEG) { sharp::AssertImageTypeDimensions(image, ImageType::JPEG); } - // Cast pixel values to float, if required - if (baton->tiffPredictor == VIPS_FOREIGN_TIFF_PREDICTOR_FLOAT) { - image = image.cast(VIPS_FORMAT_FLOAT); - } image.tiffsave(const_cast(baton->fileOut.data()), VImage::option() ->set("strip", !baton->withMetadata) ->set("Q", baton->tiffQuality) diff --git a/src/utilities.cc b/src/utilities.cc index 02347429..3dcad391 100644 --- a/src/utilities.cc +++ b/src/utilities.cc @@ -259,7 +259,7 @@ NAN_METHOD(_maxColourDistance) { } // Calculate colour distance maxColourDistance = image1.dE00(image2).max(); - } catch (VError err) { + } catch (VError const &err) { return ThrowError(err.what()); } diff --git a/test/fixtures/expected/extract-lch.jpg b/test/fixtures/expected/extract-lch.jpg index 6840777a..8de27d15 100644 Binary files a/test/fixtures/expected/extract-lch.jpg and b/test/fixtures/expected/extract-lch.jpg differ diff --git a/test/fixtures/expected/fast-shrink-on-load-false.png b/test/fixtures/expected/fast-shrink-on-load-false.png index 8fab8a42..a4c7241d 100644 Binary files a/test/fixtures/expected/fast-shrink-on-load-false.png and b/test/fixtures/expected/fast-shrink-on-load-false.png differ diff --git a/test/fixtures/expected/fast-shrink-on-load-true.png b/test/fixtures/expected/fast-shrink-on-load-true.png index e1d28756..5033da3a 100644 Binary files a/test/fixtures/expected/fast-shrink-on-load-true.png and b/test/fixtures/expected/fast-shrink-on-load-true.png differ diff --git a/test/fixtures/expected/tint-blue.jpg b/test/fixtures/expected/tint-blue.jpg index f6b3a33e..e3f4cc36 100644 Binary files a/test/fixtures/expected/tint-blue.jpg and b/test/fixtures/expected/tint-blue.jpg differ diff --git a/test/fixtures/expected/tint-green.jpg b/test/fixtures/expected/tint-green.jpg index bff7df28..b5e58c42 100644 Binary files a/test/fixtures/expected/tint-green.jpg and b/test/fixtures/expected/tint-green.jpg differ diff --git a/test/fixtures/expected/tint-red.jpg b/test/fixtures/expected/tint-red.jpg index f4167bea..f81a01c4 100644 Binary files a/test/fixtures/expected/tint-red.jpg and b/test/fixtures/expected/tint-red.jpg differ diff --git a/test/fixtures/expected/tint-sepia.jpg b/test/fixtures/expected/tint-sepia.jpg index e6c5dade..db2b8bb7 100644 Binary files a/test/fixtures/expected/tint-sepia.jpg and b/test/fixtures/expected/tint-sepia.jpg differ diff --git a/test/unit/cache.js b/test/unit/cache.js index 093b91c0..888bf886 100644 --- a/test/unit/cache.js +++ b/test/unit/cache.js @@ -1,9 +1,10 @@ 'use strict'; +const detectLibc = require('detect-libc'); const sharp = require('../../'); -// Define SHARP_TEST_WITHOUT_CACHE environment variable to prevent use of libvips' cache +const usingCache = detectLibc.family !== detectLibc.MUSL; beforeEach(function () { - sharp.cache(!process.env.SHARP_TEST_WITHOUT_CACHE); + sharp.cache(usingCache); }); diff --git a/test/unit/io.js b/test/unit/io.js index 8c5f0fb3..34b4b433 100644 --- a/test/unit/io.js +++ b/test/unit/io.js @@ -2,6 +2,7 @@ const fs = require('fs'); const assert = require('assert'); +const rimraf = require('rimraf'); const sharp = require('../../'); const fixtures = require('../fixtures'); @@ -16,7 +17,7 @@ describe('Input/output', function () { it('Read from File and write to Stream', function (done) { const writable = fs.createWriteStream(fixtures.outputJpg); - writable.on('finish', function () { + writable.on('close', function () { sharp(fixtures.outputJpg).toBuffer(function (err, data, info) { if (err) throw err; assert.strictEqual(true, data.length > 0); @@ -24,8 +25,7 @@ describe('Input/output', function () { assert.strictEqual('jpeg', info.format); assert.strictEqual(320, info.width); assert.strictEqual(240, info.height); - fs.unlinkSync(fixtures.outputJpg); - done(); + rimraf(fixtures.outputJpg, done); }); }); sharp(fixtures.inputJpg).resize(320, 240).pipe(writable); @@ -34,7 +34,7 @@ describe('Input/output', function () { it('Read from Buffer and write to Stream', function (done) { const inputJpgBuffer = fs.readFileSync(fixtures.inputJpg); const writable = fs.createWriteStream(fixtures.outputJpg); - writable.on('finish', function () { + writable.on('close', function () { sharp(fixtures.outputJpg).toBuffer(function (err, data, info) { if (err) throw err; assert.strictEqual(true, data.length > 0); @@ -42,8 +42,7 @@ describe('Input/output', function () { assert.strictEqual('jpeg', info.format); assert.strictEqual(320, info.width); assert.strictEqual(240, info.height); - fs.unlinkSync(fixtures.outputJpg); - done(); + rimraf(fixtures.outputJpg, done); }); }); sharp(inputJpgBuffer).resize(320, 240).pipe(writable); @@ -57,8 +56,7 @@ describe('Input/output', function () { assert.strictEqual('jpeg', info.format); assert.strictEqual(320, info.width); assert.strictEqual(240, info.height); - fs.unlinkSync(fixtures.outputJpg); - done(); + rimraf(fixtures.outputJpg, done); }); readable.pipe(pipeline); }); @@ -134,7 +132,7 @@ describe('Input/output', function () { it('Read from Stream and write to Stream', function (done) { const readable = fs.createReadStream(fixtures.inputJpg); const writable = fs.createWriteStream(fixtures.outputJpg); - writable.on('finish', function () { + writable.on('close', function () { sharp(fixtures.outputJpg).toBuffer(function (err, data, info) { if (err) throw err; assert.strictEqual(true, data.length > 0); @@ -142,8 +140,7 @@ describe('Input/output', function () { assert.strictEqual('jpeg', info.format); assert.strictEqual(320, info.width); assert.strictEqual(240, info.height); - fs.unlinkSync(fixtures.outputJpg); - done(); + rimraf(fixtures.outputJpg, done); }); }); const pipeline = sharp().resize(320, 240); @@ -162,10 +159,9 @@ describe('Input/output', function () { assert.strictEqual(3, info.channels); infoEventEmitted = true; }); - writable.on('finish', function () { + writable.on('close', function () { assert.strictEqual(true, infoEventEmitted); - fs.unlinkSync(fixtures.outputJpg); - done(); + rimraf(fixtures.outputJpg, done); }); readable.pipe(pipeline).pipe(writable); }); @@ -177,8 +173,7 @@ describe('Input/output', function () { anErrorWasEmitted = !!err; }).on('end', function () { assert(anErrorWasEmitted); - fs.unlinkSync(fixtures.outputJpg); - done(); + rimraf(fixtures.outputJpg, done); }); const readableButNotAnImage = fs.createReadStream(__filename); const writable = fs.createWriteStream(fixtures.outputJpg); @@ -192,8 +187,7 @@ describe('Input/output', function () { anErrorWasEmitted = !!err; }).on('end', function () { assert(anErrorWasEmitted); - fs.unlinkSync(fixtures.outputJpg); - done(); + rimraf(fixtures.outputJpg, done); }); const writable = fs.createWriteStream(fixtures.outputJpg); readableButNotAnImage.pipe(writable); @@ -202,7 +196,7 @@ describe('Input/output', function () { it('Readable side of Stream can start flowing after Writable side has finished', function (done) { const readable = fs.createReadStream(fixtures.inputJpg); const writable = fs.createWriteStream(fixtures.outputJpg); - writable.on('finish', function () { + writable.on('close', function () { sharp(fixtures.outputJpg).toBuffer(function (err, data, info) { if (err) throw err; assert.strictEqual(true, data.length > 0); @@ -210,8 +204,7 @@ describe('Input/output', function () { assert.strictEqual('jpeg', info.format); assert.strictEqual(320, info.width); assert.strictEqual(240, info.height); - fs.unlinkSync(fixtures.outputJpg); - done(); + rimraf(fixtures.outputJpg, done); }); }); const pipeline = sharp().resize(320, 240); @@ -564,8 +557,7 @@ describe('Input/output', function () { assert.strictEqual('jpeg', info.format); assert.strictEqual(320, info.width); assert.strictEqual(80, info.height); - fs.unlinkSync(fixtures.outputZoinks); - done(); + rimraf(fixtures.outputZoinks, done); }); }); @@ -578,8 +570,7 @@ describe('Input/output', function () { assert.strictEqual('png', info.format); assert.strictEqual(320, info.width); assert.strictEqual(80, info.height); - fs.unlinkSync(fixtures.outputZoinks); - done(); + rimraf(fixtures.outputZoinks, done); }); }); @@ -592,8 +583,7 @@ describe('Input/output', function () { assert.strictEqual('webp', info.format); assert.strictEqual(320, info.width); assert.strictEqual(80, info.height); - fs.unlinkSync(fixtures.outputZoinks); - done(); + rimraf(fixtures.outputZoinks, done); }); }); @@ -606,8 +596,7 @@ describe('Input/output', function () { assert.strictEqual('tiff', info.format); assert.strictEqual(320, info.width); assert.strictEqual(80, info.height); - fs.unlinkSync(fixtures.outputZoinks); - done(); + rimraf(fixtures.outputZoinks, done); }); }); @@ -620,8 +609,7 @@ describe('Input/output', function () { assert.strictEqual('png', info.format); assert.strictEqual(320, info.width); assert.strictEqual(80, info.height); - fs.unlinkSync(fixtures.outputZoinks); - done(); + rimraf(fixtures.outputZoinks, done); }); }); @@ -635,8 +623,7 @@ describe('Input/output', function () { assert.strictEqual('jpeg', info.format); assert.strictEqual(320, info.width); assert.strictEqual(80, info.height); - fs.unlinkSync(fixtures.outputZoinks); - done(); + rimraf(fixtures.outputZoinks, done); }); }); }); @@ -1080,7 +1067,7 @@ describe('Input/output', function () { if (err) throw err; assert.strictEqual('tiff', info.format); assert(info.size === startSize); - fs.unlink(fixtures.outputTiff, done); + rimraf(fixtures.outputTiff, done); }); }); @@ -1097,7 +1084,7 @@ describe('Input/output', function () { if (err) throw err; assert.strictEqual('tiff', info.format); assert(info.size < (startSize / 2)); - fs.unlink(fixtures.outputTiff, done); + rimraf(fixtures.outputTiff, done); }); }); @@ -1120,7 +1107,7 @@ describe('Input/output', function () { sharp(fixtures.outputTiff).metadata(function (err, metadata) { if (err) throw err; assert.strictEqual(metadata.density, res * 2.54); // convert to dpi - fs.unlink(fixtures.outputTiff, done); + rimraf(fixtures.outputTiff, done); }); }); }); @@ -1165,7 +1152,7 @@ describe('Input/output', function () { if (err) throw err; assert.strictEqual('tiff', info.format); assert(info.size < startSize); - fs.unlink(fixtures.outputTiff, done); + rimraf(fixtures.outputTiff, done); }); }); @@ -1181,7 +1168,7 @@ describe('Input/output', function () { if (err) throw err; assert.strictEqual('tiff', info.format); assert(info.size < startSize); - fs.unlink(fixtures.outputTiff, done); + rimraf(fixtures.outputTiff, done); }); }); @@ -1196,7 +1183,7 @@ describe('Input/output', function () { if (err) throw err; assert.strictEqual('tiff', info.format); assert(info.size < startSize); - fs.unlink(fixtures.outputTiff, done); + rimraf(fixtures.outputTiff, done); }); }); @@ -1211,7 +1198,7 @@ describe('Input/output', function () { if (err) throw err; assert.strictEqual('tiff', info.format); assert(info.size < startSize); - fs.unlink(fixtures.outputTiff, done); + rimraf(fixtures.outputTiff, done); }); }); @@ -1226,7 +1213,7 @@ describe('Input/output', function () { if (err) throw err; assert.strictEqual('tiff', info.format); assert(info.size < startSize); - fs.unlink(fixtures.outputTiff, done); + rimraf(fixtures.outputTiff, done); }); }); @@ -1240,7 +1227,7 @@ describe('Input/output', function () { if (err) throw err; assert.strictEqual('tiff', info.format); assert(info.size < startSize); - fs.unlink(fixtures.outputTiff, done); + rimraf(fixtures.outputTiff, done); }); }); @@ -1384,8 +1371,7 @@ describe('Input/output', function () { assert.strictEqual('v', info.format); assert.strictEqual(70, info.width); assert.strictEqual(60, info.height); - fs.unlinkSync(fixtures.outputV); - done(); + rimraf(fixtures.outputV, done); }); });