Giter VIP home page Giter VIP logo

magickwand.js's Issues

Cannot use in MacOS arm64

I installed, imported and used like you specified in document. But when I run I got this error:

$> node index.js
node:internal/modules/cjs/loader:1048
  const err = new Error(message);
              ^

Error: Cannot find module '/Users/thanh_da/Documents/im_nodejs/node_modules/magickwand.js/lib/binding/darwin-arm64/magickwand.node'
Require stack:
- /Users/thanh_da/Documents/im_nodejs/node_modules/magickwand.js/lib/index.cjs
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/Users/thanh_da/Documents/im_nodejs/node_modules/magickwand.js/lib/index.cjs:21:13)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at cjsLoader (node:internal/modules/esm/translators:284:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/thanh_da/Documents/im_nodejs/node_modules/magickwand.js/lib/index.cjs'
  ]
}

Node.js v20.9.0

This is the only code that use the lib

import { Magick } from "magickwand.js";

const resize = async (imageArrayBuffer, specification) => {
	const wizard = new Magick.Blob(imageArrayBuffer);
	console.log("Before transfrom", wizard.length);
	const im = new Magick.Image();
	await im.readAsync(wizard);
	return await im.resize(specification).then(() => wizard.data);
};

Can someone please explain to me, is this a library error or did I do something wrong?

This is my package.json

{
  "name": "lambda-image",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@aws-sdk/client-s3": "^3.454.0",
    "axios": "^1.6.2",
    "file-type": "^18.7.0",
    "magickwand.js": "^1.0.0-beta.6"
  }
}

Converting a Multi-Page-PDF to multiple PNG files

Hello,

I wanted to use node-magickwand to convert a PDF to separate PNG files.
In a terminal using the imagemagick cmd tool I can do this:
convert -density 150 in.pdf PNG32:out.png
and this converts the PDF to out1.png, out2.png etc.

With node-magickwand I at least managed to get the first page like

let im = new Magick.Image(null);
await im.readAsync('in.pdf');
await im.magickAsync('PNG32');
const blob = new Magick.Blob();
await im.writeAsync(blob);
await writeFile('out.png', blob.data());

But how would I load the PDF with a density of e.g. 150 and save all pages with node-magickwand?

Composite transparent images

Hi there,

I just found out about your library! Many thanks for putting this together. It looks great!

I was trying to experiment a bit with overlaying multiple images together. I want to achieve a similar "alpha blend" style as photoshop, where you can overlay multiple transparent images on top of the other. I used your example and it got me here, but this is multiplying, which I don't want and also I haven't figured out how to save the resulting image, to the disk.

Any help would be more than appreciated!

var mw = require('node-magickwand');

const test = async () => {
    let im1 = new mw.Magick.Image("image1.png");
    let im2 = new mw.Magick.Image("image2.png");
    
    await im1.compositeAsync(im2, '0x0+0+0', mw.MagickCore.MultiplyCompositeOp);
    
    const blob = new mw.Magick.Blob;
    await im1.writeAsync(blob);
    const b64 = await blob.base64Async();
    console.log(b64);
}
test()

How to set method

Hello is there an equivalent to setting webp:method=0? I can't find it.

Rebuilding when installing from npm is broken on 0.9.0

Caused by the fix of #7

Run npm install --force [email protected] --build-from-source
npm WARN using --force Recommended protections disabled.
npm ERR! code 1
npm ERR! path /home/runner/work/node-magickwand/node-magickwand/node_modules/node-magickwand
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build && npx copyfiles -sf swig/*.d.ts lib
npm ERR! Failed to execute '/opt/hostedtoolcache/node/18.17.1/x6[4](https://github.com/mmomtchev/node-magickwand/actions/runs/6186789692/job/16795209879#step:7:5)/bin/node /opt/hostedtoolcache/node/18.17.1/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/runner/work/node-magickwand/node-magickwand/node_modules/node-magickwand/lib/binding/linux-x64/node-magickwand.node --module_name=node-magickwand --module_path=/home/runner/work/node-magickwand/node-magickwand/node_modules/node-magickwand/lib/binding/linux-x64 --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | linux | x64
npm ERR! node-pre-gyp info build requesting source compile
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.17.1/node-v18.17.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.17.1/node-v18.17.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.17.1/SHASUMS2[5](https://github.com/mmomtchev/node-magickwand/actions/runs/6186789692/job/16795209879#step:7:6)[6](https://github.com/mmomtchev/node-magickwand/actions/runs/6186789692/job/16795209879#step:7:7).txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.1[7](https://github.com/mmomtchev/node-magickwand/actions/runs/6186789692/job/16795209879#step:7:8).1/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/opt/hostedtoolcache/node/1[8](https://github.com/mmomtchev/node-magickwand/actions/runs/6186789692/job/16795209879#step:7:9).[17](https://github.com/mmomtchev/node-magickwand/actions/runs/6186789692/job/16795209879#step:7:18).1/x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/runner/work/node-magickwand/node-magickwand/node_modules/node-magickwand/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/hostedtoolcache/node/[18](https://github.com/mmomtchev/node-magickwand/actions/runs/6186789692/job/16795209879#step:7:19).17.1/x64/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/runner/.cache/node-gyp/18.17.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/runner/.cache/node-gyp/18.17.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/hostedtoolcache/node/18.17.1/x64/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/runner/.cache/node-gyp/18.17.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/runner/work/node-magickwand/node-magickwand/node_modules/node-magickwand',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: node_modules/node-addon-api/except.gypi not found (cwd: /home/runner/work/node-magickwand/node-magickwand/node_modules/node-magickwand) while reading includes of binding.gyp while trying to load binding.gyp

Fail to install on MAC OS node 18 / 16 / 14

npm install node-magickwand --build-from-source

npm ERR! code 1
npm ERR! path /Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build && node scripts/gen-es6.js lib/index.mjs
npm ERR! Failed to execute '/Users/macuser/.nvm/versions/node/v18.14.0/bin/node /Users/macuser/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand/lib/binding/darwin-x64/node-magickwand.node --module_name=node-magickwand --module_path=/Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand/lib/binding/darwin-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | darwin | x64
npm ERR! node-pre-gyp info build requesting source compile
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info find Python using Python version 3.8.2 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/macuser/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/macuser/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/macuser/Library/Caches/node-gyp/18.14.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/macuser/Library/Caches/node-gyp/18.14.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/macuser/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/macuser/Library/Caches/node-gyp/18.14.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.8/site-packages/pygments'
npm ERR! Consider using the `--user` option or check the permissions.
npm ERR! 
npm ERR! WARNING: You are using pip version 19.2.3, however version 23.2.1 is available.
npm ERR! You should consider upgrading via the 'pip install --upgrade pip' command.
npm ERR! gyp: Call to '(pip3 install "conan<2.0.0" && cd build && conan install .. -pr:b=default -of build --build=missing --build=openjpeg) > /dev/null' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/macuser/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 19.6.0
npm ERR! gyp ERR! command "/Users/macuser/.nvm/versions/node/v18.14.0/bin/node" "/Users/macuser/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand/lib/binding/darwin-x64/node-magickwand.node" "--module_name=node-magickwand" "--module_path=/Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand/lib/binding/darwin-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd /Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand
npm ERR! gyp ERR! node -v v18.14.0
npm ERR! gyp ERR! node-gyp -v v9.3.0
npm ERR! gyp ERR! not ok 
npm ERR! node-pre-gyp ERR! build error 
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/Users/macuser/.nvm/versions/node/v18.14.0/bin/node /Users/macuser/.nvm/versions/node/v18.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand/lib/binding/darwin-x64/node-magickwand.node --module_name=node-magickwand --module_path=/Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand/lib/binding/darwin-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/macuser/practices/imageCompression/magick/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Darwin 19.6.0
npm ERR! node-pre-gyp ERR! command "/Users/macuser/.nvm/versions/node/v18.14.0/bin/node" "/Users/macuser/practices/imageCompression/magick/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Users/macuser/practices/imageCompression/magick/node_modules/node-magickwand
npm ERR! node-pre-gyp ERR! node -v v18.14.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/macuser/.npm/_logs/2023-10-05T19_36_22_455Z-debug-0.log

Failed to build on macOS 14 arm64

❯ npm install node-magickwand
npm ERR! code 1
npm ERR! path /Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build && node scripts/gen-es6.js lib/index.mjs
npm ERR! Failed to execute '/opt/homebrew/Cellar/node@18/18.17.1/bin/node /opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64/node-magickwand.node --module_name=node-magickwand --module_path=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64 --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64/node-magickwand.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/mmomtchev/node-magickwand/releases/download/v0.9.7/darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/mmomtchev/node-magickwand/releases/download/v0.9.7/darwin-arm64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v108 ABI, unknown) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/mmomtchev/node-magickwand/releases/download/v0.9.7/darwin-arm64.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.6 found at "/opt/homebrew/opt/[email protected]/bin/python3.11"
npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.11
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/jackmatthews/Library/Caches/node-gyp/18.17.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/jackmatthews/Library/Caches/node-gyp/18.17.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/jackmatthews/Library/Caches/node-gyp/18.17.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.21.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cffi-1.16.0.dist-info due to invalid metadata entry 'name'
npm ERR! DEPRECATION: Loading egg at /opt/homebrew/lib/python3.11/site-packages/mtkclient-1.6.3-py3.11.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.21.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cffi-1.16.0.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.21.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cffi-1.16.0.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/pycparser-2.21.dist-info due to invalid metadata entry 'name'
npm ERR! WARNING: Skipping /opt/homebrew/lib/python3.11/site-packages/cffi-1.16.0.dist-info due to invalid metadata entry 'name'
npm ERR! 
npm ERR! [notice] A new release of pip is available: 23.2.1 -> 23.3
npm ERR! [notice] To update, run: python3.11 -m pip install --upgrade pip
npm ERR! WARN: openexr/3.1.5: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: freetype/2.13.0: requirement libpng/1.6.40 overridden by fontconfig/2.14.2 to libpng/1.6.39 
npm ERR! WARN: freetype/2.13.0: requirement zlib/[>=1.2.10 <2] overridden by fontconfig/2.14.2 to zlib/1.2.13 
npm ERR! WARN: freetype/2.13.0: requirement brotli/1.1.0 overridden by fontconfig/2.14.2 to brotli/1.0.9 
npm ERR! WARN: libpng/1.6.39: requirement zlib/[>=1.2.11 <2] overridden by freetype/2.13.0 to zlib/1.2.13 
npm ERR! WARN: glib/2.78.0: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: pcre2/10.42: requirement zlib/[>=1.2.11 <2] overridden by glib/2.78.0 to zlib/1.2.13 
npm ERR! WARN: harfbuzz/7.1.0: requirement glib/2.77.0 overridden by your conanfile to glib/2.78.0 
npm ERR! WARN: libheif/1.13.0: requirement libde265/1.0.12 overridden by your conanfile to libde265/1.0.11 
npm ERR! WARN: libraw/0.21.1: requirement libjpeg-turbo/2.1.5 overridden by your conanfile to libjpeg-turbo/3.0.0 
npm ERR! WARN: libtiff/4.6.0: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: libxml2/2.10.4: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: libzip/1.9.2: requirement zlib/[>=1.2.11 <2] overridden by your conanfile to zlib/1.2.13 
npm ERR! WARN: libzip/1.9.2: requirement xz_utils/5.4.2 overridden by your conanfile to xz_utils/5.4.4 
npm ERR! WARN: openssl/3.1.3: requirement zlib/[>=1.2.11 <2] overridden by libzip/1.9.2 to zlib/1.2.13 
npm ERR! harfbuzz/7.1.0: WARN: Package binary is corrupted, removing: 4b6a6193d24485c01c73fda8ce1844d971a9fd4b
npm ERR! WARN: pcre2/10.42: requirement zlib/[>=1.2.11 <2] overridden by glib/2.78.0 to zlib/1.2.13 
npm ERR! CMake Deprecation Warning at CMakeLists.txt:10 (cmake_minimum_required):
npm ERR!   Compatibility with CMake < 3.5 will be removed from a future version of
npm ERR!   CMake.
npm ERR! 
npm ERR!   Update the VERSION argument <min> value or use a ...<max> suffix to tell
npm ERR!   CMake that the project does not need compatibility with older versions.
npm ERR! 
npm ERR! 
npm ERR! harfbuzz/7.1.0: WARN: Build folder is dirty, removing it: /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b
npm ERR! harfbuzz/7.1.0: ERROR: Package '4b6a6193d24485c01c73fda8ce1844d971a9fd4b' build failed
npm ERR! harfbuzz/7.1.0: WARN: Build folder /Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release
npm ERR! ERROR: harfbuzz/7.1.0: Error in build() method, line 161
npm ERR!        meson.configure()
npm ERR!        ConanException: Error 1 while executing meson setup --native-file "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release/conan/conan_meson_native.ini" "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/build-release" "/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/build/4b6a6193d24485c01c73fda8ce1844d971a9fd4b/src" -Dprefix="/Users/jackmatthews/.conan/data/harfbuzz/7.1.0/_/_/package/4b6a6193d24485c01c73fda8ce1844d971a9fd4b"
npm ERR! gyp: Call to '(pip3 install --user "conan<2.0.0" && cd build && python3 -m conans.conan install .. -pr:b=default -of build --build=missing --build=openjpeg) > /dev/null' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:325:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 23.0.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node@18/18.17.1/bin/node" "/opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64/node-magickwand.node" "--module_name=node-magickwand" "--module_path=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
npm ERR! gyp ERR! cwd /Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand
npm ERR! gyp ERR! node -v v18.17.1
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok 
npm ERR! node-pre-gyp ERR! build error 
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/opt/homebrew/Cellar/node@18/18.17.1/bin/node /opt/homebrew/Cellar/node@18/18.17.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64/node-magickwand.node --module_name=node-magickwand --module_path=/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand/lib/binding/darwin-arm64 --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Darwin 23.0.0
npm ERR! node-pre-gyp ERR! command "/opt/homebrew/Cellar/node@18/18.17.1/bin/node" "/Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Users/jackmatthews/Projects/DecorProject/decor-server/node_modules/node-magickwand
npm ERR! node-pre-gyp ERR! node -v v18.17.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /Users/jackmatthews/.npm/_logs/2023-10-18T04_48_25_721Z-debug-0.log

Looks like an issue with harfbuzz? Wasn't able to determine the issue in harfbuzz though.

Faile to new Image in x86 macOS, node version 20.12.1

Hello author, I have encountered some error that make the project can not proceed normally, so I have to come here for help.

After I installed node-magickwand via npm on an x86 mac, I executed the following code:

const { Magick } = require('magickwand.js')
async function main() {
    const filePath = '/Users/deadfish/Documents/project/deadfish/Photography2Client/testFiles/DSC_6880.NEF'
    const largeWand = new Magick.Image(filePath)
}
main()

And here is the error information:

/test.js:4
    const largeWand = new Magick.Image(filePath)
                      ^

Error: node: unable to open image '/var/folders/s7/h94j1mz54_bd7ss0xk1h891r0000gn/T/magick-u16WoVnI3F6lzl0HbDLctNjtbwfzfrTU.ppm': No such file or directory @ error/blob.c/OpenBlob/3571
    at main (/Users/deadfish/Documents/project/deadfish/Photography2Client/p2p-pick/photographyClient/test.js:4:23)
    at Object.<anonymous> (/Users/deadfish/Documents/project/deadfish/Photography2Client/p2p-pick/photographyClient/test.js:7:1)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49

Node.js v20.12.1

It works fine on windows, but faile on macOS, version Monterry 12.6.2(21G320).

I understand that I can use magick in software by calling system commands, but this is too cumbersome for the user, so hopefully We can find the cause of this error.

Rebuilding when installing on macOS/Linux from npm is broken on 0.9.2

npm install node-magickwand --build-from-source fails with:

In file included from ../deps/ImageMagick/Magick++/lib/Magick++/Include.h:16,
                 from ../deps/ImageMagick/Magick++/lib/Magick++.h:12,
                 from ../swig/Magick++.cxx:1981:
../deps/ImageMagick/MagickCore/magick-config.h:25:10: fatal error: MagickCore/magick-baseconfig.h: No such file or directory
   25 | #include "MagickCore/magick-baseconfig.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.