tomterl / metalsmith-convert Goto Github PK
View Code? Open in Web Editor NEWConvert images with imagemagick (via imagemagick-native).
License: MIT License
Convert images with imagemagick (via imagemagick-native).
License: MIT License
Hey I'm getting the following error when I try installing this package:
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/imagemagick/src/imagemagick.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit
(/Users/edward/.nvm/versions/node/v5.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:88:13)
gyp ERR! stack at ChildProcess.emit (events.js:173:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12)
gyp ERR! System Darwin 16.1.0
gyp ERR! command "/Users/edward/.nvm/versions/node/v5.2.0/bin/node"
"/Users/edward/.nvm/versions/node/v5.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/edward/Sites/art/node_modules/imagemagick-native
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
[email protected] /Users/edward/Sites/art └── [email protected]
npm WARN [email protected] No repository field.
npm ERR! Darwin 16.1.0
npm ERR! argv "/Users/edward/.nvm/versions/node/v5.2.0/bin/node"
"/Users/edward/.nvm/versions/node/v5.2.0/bin/npm" "install" "--save" "metalsmith-convert"
npm ERR! node v5.2.0
npm ERR! npm v3.8.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
p.s. I have installed imagemagick 7.0.4-6 via brew...
any help would be appreciated, thank you!
Installing this package from npm no longer works if you're using a more recent version of nodejs (v4.x or v5.x) this is due to a current failure in NaN. There is a patch involved but it means working with a specific branch of imagemacgick-native and using that as the dependency.
See this comment here for more information. elad/node-imagemagick-native#102 (comment)
Doing a clone of metalsmith-convert, changing the install location to this branch elad/node-imagemagick-native.git#travis-4.1
and then installing locally into my project allows me to use metalsmith-convert absolutely as normal.
Happy to submit a PR if you want however wasn't certain of how to run the tests etc to package it all up properly to validate nothing else has broken as a result of the upgrade.
Right now this doesn't work on io.js. This should be fixed once the new version of node-imagemagick
is published (1.7.0 >) and the package.json
of metalsmith-convert
is updated.
I would love to have something like a stup option.
So that the files are just renamed without transforming them.
This would increase the building process in development.
Would be great to be able to leave out the target format and keep the original format when using a multi extension glob pattern.
example files:
image.png
secondimage.jpg
{
"src": "**/*.{png,gif,jpg}",
"target": "jpg",
"resize": {width: 3200, height: 2000, resizeStyle: 'aspectfit'},
"nameFormat": "%b_max%e"
}
output >
image.jpg
secondimage.jpg
{
"src": "**/*.{png,gif,jpg}",
"resize": {width: 3200, height: 2000, resizeStyle: 'aspectfit'},
"nameFormat": "%b_max%e"
}
output >
image.png
secondimage.jpg
Please, Have you any benchmart for converting 100 images ?
.use(convert({
src: '*/.jpg',
target: 'png'
}))
seems unusable to me and seems to block whole build process for minutes
Doing the following only serves me the first file size, but not the second:
.use(convert(
{
"src": "**/*.jpg",
"target": "jpg",
"resize": {width: 3200, height: 2000, resizeStyle: 'aspectfit'},
"nameFormat": "%b_max%e"
},
{
"src": "**/*.jpg",
"target": "jpg",
"resize": {width: 320, height: 240, resizeStyle: 'aspectfit'},
"nameFormat": "%b_thumb%e"
}))
Is there a way to configure it to create 2 different file sizes?
Thanks!
Keeping the original filename and removing the original source file don't play well together.
"nameFormat": "%b%e",
"remove": true
This removes the converted file, which is confusing and not what the documentation describes. Only the source file should be removed.
Of course there can't be two files with the same name. So maybe in that case the source file should get a suffix like _source
or _org
?
Could you maybe add an option to select the filename of the output?
I'd like to use something like filename_thumb.ext
instead of filename_xxx_yyy.ext
.
This way it's easier to finetune some image sizes later on without having to change it everywhere it was used.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.