Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageMagick7 and "Input file contains unsupported image format" #2864

Closed
paulstraw opened this issue Aug 27, 2021 · 6 comments
Closed

ImageMagick7 and "Input file contains unsupported image format" #2864

paulstraw opened this issue Aug 27, 2021 · 6 comments

Comments

@paulstraw
Copy link
Contributor

Hi there. I'm running into an issue which seems very similar to #2303. My goal is to get sharp running with ImageMagick and lots of other tools (libheif, libwebp, etc) on a Docker image destined for AWS Lambda. Everything is working well except for ImageMagick. It's detected during libvips installation, and can be used with e.g. vips magickload, but trying to load a .bmp or other IM-compatible file with sharp gives "Input file contains unsupported image format". I've created a basic repro of the problem here: https://github.com/paulstraw/sharp-magick-lambda

Thanks very much for your help, and your work on sharp. Please let me know if there's any additional information I can provide.


Did you see the documentation relating to installation?

Yep, I've referenced this doc extensively, and it's been very helpful in getting this far.

Have you ensured the architecture and platform of Node.js used for npm install is the same as the architecture and platform of Node.js used at runtime?

Yes, there is only one Node installed on the Docker image I'm using.

Are you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest?

Yes, sharp 0.29.0.

If you are using npm v6 or earlier and installing as a root or sudo user, have you tried with the npm install --unsafe-perm flag?

Yes, although I've also tried without, and installation appears to work successfully either way.

If you are using npm v7, does the user running npm install own the directory it is run in?

N/A

If you are using the ignore-scripts feature of npm, have you tried with the npm install --ignore-scripts=false flag?

N/A

What is the complete output of running npm install --verbose sharp? Have you checked this output for useful error messages?

Yes. I don't see any errors, and the system libvips is detected.

npm install --verbose sharp

# npm install --verbose sharp
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/var/lang/bin/node',
npm verb cli   '/var/lang/bin/npm',
npm verb cli   'install',
npm verb cli   '--verbose',
npm verb cli   'sharp'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session e53379bbc505ec01
npm http fetch GET 200 https://registry.npmjs.org/sharp 406ms
npm http fetch GET 200 https://registry.npmjs.org/sharp/-/sharp-0.29.0.tgz 27ms (from cache)
npm timing stage:loadCurrentTree Completed in 812ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 2ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 102ms
npm http fetch GET 200 https://registry.npmjs.org/color 89ms
npm http fetch GET 200 https://registry.npmjs.org/color/-/color-4.0.1.tgz 41ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/detect-libc 154ms
npm http fetch GET 200 https://registry.npmjs.org/semver 150ms
npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent 146ms
npm http fetch GET 200 https://registry.npmjs.org/simple-get 150ms
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 152ms
npm http fetch GET 200 https://registry.npmjs.org/node-addon-api 162ms
npm http fetch GET 200 https://registry.npmjs.org/tar-fs 162ms
npm http fetch GET 200 https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz 34ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz 33ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz 40ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-7.3.5.tgz 51ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz 53ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.1.0.tgz 56ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz 58ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/color-string 46ms
npm http fetch GET 200 https://registry.npmjs.org/color-convert 50ms
npm http fetch GET 200 https://registry.npmjs.org/color-string/-/color-string-1.6.0.tgz 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/color-name 40ms
npm http fetch GET 200 https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz 7ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle 43ms
npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz 9ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 31ms
npm http fetch GET 200 https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/expand-template 68ms
npm http fetch GET 200 https://registry.npmjs.org/rc 68ms
npm http fetch GET 200 https://registry.npmjs.org/github-from-package 77ms
npm http fetch GET 200 https://registry.npmjs.org/minimist 77ms
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 81ms
npm http fetch GET 200 https://registry.npmjs.org/npmlog 85ms
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 86ms
npm http fetch GET 200 https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz 31ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/rc/-/rc-1.2.8.tgz 36ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz 33ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz 36ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz 32ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz 33ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz 34ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/pump 131ms
npm http fetch GET 200 https://registry.npmjs.org/pump/-/pump-3.0.0.tgz 13ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/node-abi 158ms
npm http fetch GET 200 https://registry.npmjs.org/node-abi/-/node-abi-2.30.0.tgz 7ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-5.7.1.tgz 7ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet 39ms
npm http fetch GET 200 https://registry.npmjs.org/set-blocking 44ms
npm http fetch GET 200 https://registry.npmjs.org/console-control-strings 52ms
npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz 18ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz 15ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/gauge 69ms
npm http fetch GET 200 https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz 17ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/delegates 32ms
npm http fetch GET 200 https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz 8ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/readable-stream 50ms
npm http fetch GET 200 https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/isarray 50ms
npm http fetch GET 200 https://registry.npmjs.org/process-nextick-args 55ms
npm http fetch GET 200 https://registry.npmjs.org/core-util-is 60ms
npm http fetch GET 200 https://registry.npmjs.org/util-deprecate 58ms
npm http fetch GET 200 https://registry.npmjs.org/inherits 75ms
npm http fetch GET 200 https://registry.npmjs.org/safe-buffer 74ms
npm http fetch GET 200 https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz 24ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/string_decoder 78ms
npm http fetch GET 200 https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz 23ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz 23ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz 25ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz 16ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz 21ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz 20ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/has-unicode 55ms
npm http fetch GET 200 https://registry.npmjs.org/object-assign 57ms
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi 55ms
npm http fetch GET 200 https://registry.npmjs.org/string-width 66ms
npm http fetch GET 200 https://registry.npmjs.org/wide-align 66ms
npm http fetch GET 200 https://registry.npmjs.org/aproba 77ms
npm http fetch GET 200 https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz 21ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz 27ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz 36ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/signal-exit 102ms
npm http fetch GET 200 https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz 38ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz 36ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz 38ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz 18ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/code-point-at 32ms
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point 42ms
npm http fetch GET 200 https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/number-is-nan 30ms
npm http fetch GET 200 https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz 7ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex 29ms
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz 5ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/end-of-stream 38ms
npm http fetch GET 200 https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz 15ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/once 123ms
npm http fetch GET 200 https://registry.npmjs.org/once/-/once-1.4.0.tgz 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/wrappy 35ms
npm http fetch GET 200 https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz 9ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments 38ms
npm http fetch GET 200 https://registry.npmjs.org/ini 55ms
npm http fetch GET 200 https://registry.npmjs.org/deep-extend 56ms
npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz 12ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/ini/-/ini-1.3.8.tgz 13ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz 15ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/simple-concat 32ms
npm http fetch GET 200 https://registry.npmjs.org/decompress-response 38ms
npm http fetch GET 200 https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz 12ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz 12ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/mimic-response 48ms
npm http fetch GET 200 https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz 7ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/chownr 31ms
npm http fetch GET 200 https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz 13ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/tar-stream 60ms
npm http fetch GET 200 https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz 11ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/fs-constants 30ms
npm http fetch GET 200 https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz 8ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/bl 56ms
npm http fetch GET 200 https://registry.npmjs.org/bl/-/bl-4.1.0.tgz 5ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/buffer 43ms
npm http fetch GET 200 https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz 9ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/ieee754 38ms
npm http fetch GET 200 https://registry.npmjs.org/base64-js 45ms
npm http fetch GET 200 https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz 11ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz 9ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/lru-cache 38ms
npm http fetch GET 200 https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz 8ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/yallist 37ms
npm http fetch GET 200 https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz 11ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 2174ms
npm timing stage:loadIdealTree Completed in 2318ms
npm timing stage:generateActionsToTake Completed in 36ms
npm verb correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /root/.npm/_locks/staging-1313e7c4addbfc02.lock for /var/task/node_modules/.staging
npm timing audit submit Completed in 79ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 81ms
npm timing audit body Completed in 2ms
npm timing action:extract Completed in 78ms
npm timing action:finalize Completed in 9ms
npm timing action:refresh-package-json Completed in 18ms
npm info lifecycle [email protected]~preinstall: [email protected]
npm timing action:preinstall Completed in 3ms
npm info linkStuff [email protected]
npm timing action:build Completed in 3ms
npm info lifecycle [email protected]~install: [email protected]

> [email protected] install /var/task/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Detected globally-installed libvips v8.11.3
sharp: Building from source via node-gyp
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/var/lang/bin/node',
gyp verb cli   '/var/lang/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild'
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python" can be used
gyp verb find Python - executing "python" to get executable path
gyp verb find Python - executable path is "/usr/bin/python"
gyp verb find Python - executing "/usr/bin/python" to get version
gyp verb find Python - version is "2.7.18"
gyp info find Python using Python version 2.7.18 found at "/usr/bin/python"
gyp verb get node dir no --target version specified, falling back to host node version: 14.17.5
gyp verb command install [ '14.17.5' ]
gyp verb install input version string "14.17.5"
gyp verb install installing version: 14.17.5
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 14.17.5
gyp verb build dir attempting to create "build" dir: /var/task/node_modules/sharp/build
gyp verb build dir "build" dir needed to be created? /var/task/node_modules/sharp/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /var/task/node_modules/sharp/build/config.gypi
gyp verb config.gypi checking for gypi file: /var/task/node_modules/sharp/config.gypi
gyp verb common.gypi checking for gypi file: /var/task/node_modules/sharp/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/var/lang/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/var/task/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/var/lang/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/14.17.5/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/14.17.5',
gyp info spawn args   '-Dnode_gyp_dir=/var/lang/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/14.17.5/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/var/task/node_modules/sharp',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /root/.cache/node-gyp/14.17.5
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/var/task/node_modules/sharp/build'
  cc '-DNODE_GYP_MODULE_NAME=nothing' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I/root/.cache/node-gyp/14.17.5/include/node -I/root/.cache/node-gyp/14.17.5/src -I/root/.cache/node-gyp/14.17.5/deps/openssl/config -I/root/.cache/node-gyp/14.17.5/deps/openssl/openssl/include -I/root/.cache/node-gyp/14.17.5/deps/uv/include -I/root/.cache/node-gyp/14.17.5/deps/zlib -I/root/.cache/node-gyp/14.17.5/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer  -MMD -MF ./Release/.deps/Release/obj.target/nothing/../node-addon-api/nothing.o.d.raw   -c -o Release/obj.target/nothing/../node-addon-api/nothing.o ../../node-addon-api/nothing.c
  rm -f Release/obj.target/../node-addon-api/nothing.a && ar crs Release/obj.target/../node-addon-api/nothing.a Release/obj.target/nothing/../node-addon-api/nothing.o
  rm -rf "Release/nothing.a" && cp -af "Release/obj.target/../node-addon-api/nothing.a" "Release/nothing.a"
  touch Release/obj.target/libvips-cpp.stamp
  g++ '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=5' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DBUILDING_NODE_EXTENSION' -I/root/.cache/node-gyp/14.17.5/include/node -I/root/.cache/node-gyp/14.17.5/src -I/root/.cache/node-gyp/14.17.5/deps/openssl/config -I/root/.cache/node-gyp/14.17.5/deps/openssl/openssl/include -I/root/.cache/node-gyp/14.17.5/deps/uv/include -I/root/.cache/node-gyp/14.17.5/deps/zlib -I/root/.cache/node-gyp/14.17.5/deps/v8/include -I../../node-addon-api -I/usr/local/include -I/usr/local/include/ImageMagick-7 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/orc-0.4  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -fexceptions -Wall -Os -Wno-cast-function-type -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/src/common.o.d.raw   -c -o Release/obj.target/sharp-linux-x64/src/common.o ../src/common.cc
  g++ '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=5' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DBUILDING_NODE_EXTENSION' -I/root/.cache/node-gyp/14.17.5/include/node -I/root/.cache/node-gyp/14.17.5/src -I/root/.cache/node-gyp/14.17.5/deps/openssl/config -I/root/.cache/node-gyp/14.17.5/deps/openssl/openssl/include -I/root/.cache/node-gyp/14.17.5/deps/uv/include -I/root/.cache/node-gyp/14.17.5/deps/zlib -I/root/.cache/node-gyp/14.17.5/deps/v8/include -I../../node-addon-api -I/usr/local/include -I/usr/local/include/ImageMagick-7 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/orc-0.4  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -fexceptions -Wall -Os -Wno-cast-function-type -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/src/metadata.o.d.raw   -c -o Release/obj.target/sharp-linux-x64/src/metadata.o ../src/metadata.cc
  g++ '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=5' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DBUILDING_NODE_EXTENSION' -I/root/.cache/node-gyp/14.17.5/include/node -I/root/.cache/node-gyp/14.17.5/src -I/root/.cache/node-gyp/14.17.5/deps/openssl/config -I/root/.cache/node-gyp/14.17.5/deps/openssl/openssl/include -I/root/.cache/node-gyp/14.17.5/deps/uv/include -I/root/.cache/node-gyp/14.17.5/deps/zlib -I/root/.cache/node-gyp/14.17.5/deps/v8/include -I../../node-addon-api -I/usr/local/include -I/usr/local/include/ImageMagick-7 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/orc-0.4  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -fexceptions -Wall -Os -Wno-cast-function-type -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/src/stats.o.d.raw   -c -o Release/obj.target/sharp-linux-x64/src/stats.o ../src/stats.cc
  g++ '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=5' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DBUILDING_NODE_EXTENSION' -I/root/.cache/node-gyp/14.17.5/include/node -I/root/.cache/node-gyp/14.17.5/src -I/root/.cache/node-gyp/14.17.5/deps/openssl/config -I/root/.cache/node-gyp/14.17.5/deps/openssl/openssl/include -I/root/.cache/node-gyp/14.17.5/deps/uv/include -I/root/.cache/node-gyp/14.17.5/deps/zlib -I/root/.cache/node-gyp/14.17.5/deps/v8/include -I../../node-addon-api -I/usr/local/include -I/usr/local/include/ImageMagick-7 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/orc-0.4  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -fexceptions -Wall -Os -Wno-cast-function-type -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/src/operations.o.d.raw   -c -o Release/obj.target/sharp-linux-x64/src/operations.o ../src/operations.cc
  g++ '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=5' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DBUILDING_NODE_EXTENSION' -I/root/.cache/node-gyp/14.17.5/include/node -I/root/.cache/node-gyp/14.17.5/src -I/root/.cache/node-gyp/14.17.5/deps/openssl/config -I/root/.cache/node-gyp/14.17.5/deps/openssl/openssl/include -I/root/.cache/node-gyp/14.17.5/deps/uv/include -I/root/.cache/node-gyp/14.17.5/deps/zlib -I/root/.cache/node-gyp/14.17.5/deps/v8/include -I../../node-addon-api -I/usr/local/include -I/usr/local/include/ImageMagick-7 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/orc-0.4  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -fexceptions -Wall -Os -Wno-cast-function-type -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/src/pipeline.o.d.raw   -c -o Release/obj.target/sharp-linux-x64/src/pipeline.o ../src/pipeline.cc
  g++ '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=5' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DBUILDING_NODE_EXTENSION' -I/root/.cache/node-gyp/14.17.5/include/node -I/root/.cache/node-gyp/14.17.5/src -I/root/.cache/node-gyp/14.17.5/deps/openssl/config -I/root/.cache/node-gyp/14.17.5/deps/openssl/openssl/include -I/root/.cache/node-gyp/14.17.5/deps/uv/include -I/root/.cache/node-gyp/14.17.5/deps/zlib -I/root/.cache/node-gyp/14.17.5/deps/v8/include -I../../node-addon-api -I/usr/local/include -I/usr/local/include/ImageMagick-7 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/orc-0.4  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -fexceptions -Wall -Os -Wno-cast-function-type -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/src/utilities.o.d.raw   -c -o Release/obj.target/sharp-linux-x64/src/utilities.o ../src/utilities.cc
  g++ '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_VERSION=5' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DBUILDING_NODE_EXTENSION' -I/root/.cache/node-gyp/14.17.5/include/node -I/root/.cache/node-gyp/14.17.5/src -I/root/.cache/node-gyp/14.17.5/deps/openssl/config -I/root/.cache/node-gyp/14.17.5/deps/openssl/openssl/include -I/root/.cache/node-gyp/14.17.5/deps/uv/include -I/root/.cache/node-gyp/14.17.5/deps/zlib -I/root/.cache/node-gyp/14.17.5/deps/v8/include -I../../node-addon-api -I/usr/local/include -I/usr/local/include/ImageMagick-7 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/orc-0.4  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -fexceptions -Wall -Os -Wno-cast-function-type -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/src/sharp.o.d.raw   -c -o Release/obj.target/sharp-linux-x64/src/sharp.o ../src/sharp.cc
  g++ -shared -pthread -rdynamic -m64  -Wl,-soname=sharp-linux-x64.node -o Release/obj.target/sharp-linux-x64.node -Wl,--start-group Release/obj.target/sharp-linux-x64/src/common.o Release/obj.target/sharp-linux-x64/src/metadata.o Release/obj.target/sharp-linux-x64/src/stats.o Release/obj.target/sharp-linux-x64/src/operations.o Release/obj.target/sharp-linux-x64/src/pipeline.o Release/obj.target/sharp-linux-x64/src/utilities.o Release/obj.target/sharp-linux-x64/src/sharp.o Release/obj.target/../node-addon-api/nothing.a -Wl,--end-group -L/usr/local/lib -lvips-cpp -lvips -lgobject-2.0 -lglib-2.0
  rm -rf "Release/sharp-linux-x64.node" && cp -af "Release/obj.target/sharp-linux-x64.node" "Release/sharp-linux-x64.node"
make: Leaving directory `/var/task/node_modules/sharp/build'
gyp info ok
npm verb lifecycle [email protected]~install: unsafe-perm in lifecycle false
npm verb lifecycle [email protected]~install: PATH: /var/lang/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/task/node_modules/sharp/node_modules/.bin:/var/task/node_modules/.bin:/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin
npm verb lifecycle [email protected]~install: CWD: /var/task/node_modules/sharp
npm timing action:install Completed in 16485ms
npm info lifecycle [email protected]~postinstall: [email protected]
npm timing action:postinstall Completed in 2ms
npm verb unlock done using /root/.npm/_locks/staging-1313e7c4addbfc02.lock for /var/task/node_modules/.staging
npm timing stage:executeActions Completed in 16626ms
npm timing stage:rollbackFailedOptional Completed in 0ms
npm timing stage:runTopLevelLifecycles Completed in 19874ms
npm verb saving [ { name: 'sharp', spec: '^0.29.0', save: 'dependencies' } ]
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle [email protected]~shrinkwrap: [email protected]
npm verb shrinkwrap skipping write for package-lock.json because there were no changes.
npm info lifecycle [email protected]~postshrinkwrap: [email protected]
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 1 package from 74 contributors and audited 68 packages in 19.982s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm verb exit [ 0, true ]
npm timing npm Completed in 20902ms
npm info ok

What is the output of running npx envinfo --binaries --system?

# npx envinfo --binaries --system
npx: installed 1 in 1.978s

  System:
    OS: Linux 5.10 Amazon Linux 2
    CPU: (4) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 714.33 MB / 1.94 GB
    Container: Yes
    Shell: 4.2.46 - /bin/bash
  Binaries:
    Node: 14.17.5 - /var/lang/bin/node
    npm: 6.14.14 - /var/lang/bin/npm
@lovell
Copy link
Owner

lovell commented Aug 27, 2021

What is the output of running the following commands within this container?

  • node -p "require('sharp').format"
  • convert -list format | grep BMP

https://sharp.pixelplumbing.com/api-utility#format

@paulstraw
Copy link
Contributor Author

# node -p "require('sharp').format"
{
  jpeg: {
    id: 'jpeg',
    input: { file: true, buffer: true, stream: true },
    output: { file: true, buffer: true, stream: true }
  },
  png: {
    id: 'png',
    input: { file: false, buffer: false, stream: false },
    output: { file: false, buffer: false, stream: false }
  },
  webp: {
    id: 'webp',
    input: { file: false, buffer: false, stream: false },
    output: { file: false, buffer: false, stream: false }
  },
  tiff: {
    id: 'tiff',
    input: { file: false, buffer: false, stream: false },
    output: { file: false, buffer: false, stream: false }
  },
  magick: {
    id: 'magick',
    input: { file: true, buffer: true, stream: true },
    output: { file: true, buffer: true, stream: true }
  },
  openslide: {
    id: 'openslide',
    input: { file: false, buffer: false, stream: false },
    output: { file: false, buffer: false, stream: false }
  },
  dz: {
    id: 'dz',
    input: { file: false, buffer: false, stream: false },
    output: { file: false, buffer: false, stream: false }
  },
  ppm: {
    id: 'ppm',
    input: { file: true, buffer: false, stream: false },
    output: { file: true, buffer: false, stream: false }
  },
  fits: {
    id: 'fits',
    input: { file: false, buffer: false, stream: false },
    output: { file: false, buffer: false, stream: false }
  },
  gif: {
    id: 'gif',
    input: { file: true, buffer: true, stream: true },
    output: { file: false, buffer: false, stream: false }
  },
  svg: {
    id: 'svg',
    input: { file: false, buffer: false, stream: false },
    output: { file: false, buffer: false, stream: false }
  },
  heif: {
    id: 'heif',
    input: { file: false, buffer: false, stream: false },
    output: { file: false, buffer: false, stream: false }
  },
  pdf: {
    id: 'pdf',
    input: { file: false, buffer: false, stream: false },
    output: { file: false, buffer: false, stream: false }
  },
  vips: {
    id: 'vips',
    input: { file: true, buffer: false, stream: false },
    output: { file: true, buffer: false, stream: false }
  },
  raw: {
    id: 'raw',
    input: { file: false, buffer: true, stream: true },
    output: { file: false, buffer: true, stream: true }
  }
}
# convert -list format | grep BMP
      BMP* BMP       rw-   Microsoft Windows bitmap image
     BMP2* BMP       rw-   Microsoft Windows bitmap image (V2)
     BMP3* BMP       rw-   Microsoft Windows bitmap image (V3)
     WBMP* WBMP      rw-   Wireless Bitmap (level 0) image

@lovell
Copy link
Owner

lovell commented Aug 27, 2021

Thank you, it looks like commit 573ed5f might have broken ImageMagick 7 compatibility. I think we need to add VipsForeignLoadMagick7File and VipsForeignLoadMagick7Buffer as keys in the loaderToType map. PR welcome if you're able.

@lovell lovell added bug and removed installation labels Aug 27, 2021
@lovell lovell changed the title ImageMagick-compatible files and "Input file contains unsupported image format" ImageMagick7 and "Input file contains unsupported image format" Aug 27, 2021
@paulstraw
Copy link
Contributor Author

Cool! I'll take a look at this over the weekend and see if I can get it fixed, thanks for the super quick response.

@paulstraw
Copy link
Contributor Author

@lovell After looking at #2258, I think I have a good understanding of this change. I can confirm whether it works locally, but not really sure how I would write tests for it. Any pointers?

@lovell
Copy link
Owner

lovell commented Sep 7, 2021

v0.29.1 now available, thanks for both reporting and fixing this.

@lovell lovell closed this as completed Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants