Comments (3)
can you provide a test case. want to make sure it's fixed properly
from gm.
Sure thing. Given the following code:
var url = require('url')
var http = require('http')
var gm = require('gm')
http.get(url.parse('http://www.google.com/images/srpr/logo3w.png'), function (resp) {
gm(resp, 'logo3w.png').stream(function (err, stdout, stderr) {
if (err) {
console.error('Error processing image', err)
} else {
stdout.on('data', function (chunk) {
console.log('Chunk recieved', chunk.length)
})
stdout.on('end', function () {
console.log('Stream ended')
})
}
})
})
.on('error', function (err) {
console.error('Error fetching image', err)
})
With graphicsmagick installed:
$ node gm-test.js
Chunk recieved 7078
Stream ended
If gm is not installed I would expect:
$ node gm-test.js
Error processing image, Error: graphicsmagick not available.
at [some nice stack trace]
What actually happens if gm is not installed:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: write EPIPE
at errnoException (net.js:670:11)
at Object.afterWrite [as oncomplete] (net.js:503:19)
Note, none of the error callbacks are called.
Thanks for looking.
from gm.
tracked it down. the callback to gm(resp, 'logo3w.png').stream(function (err, stdout, stderr) {
is already called by the time the error occurs on the internal child process stdin
stream so its too late to pass the err to the callback. instead, to detect this case you can test the output of stderr for "execvp(): No such file or directory"
from gm.
Related Issues (20)
- Accelerate gif
- works locally, but on Lambda getting "params.Body is required" error HOT 1
- Update URL in About
- want to have Resolution Unit
- Circle Pixels
- Production service (nodeJS/express) crash processing a user uploaded image/file HOT 2
- GraphicsMagick CLI supports also one parameter for density like ImageMagick
- Any way to composite a current GraphicsMagick object onto another image?
- appPath is not being read correctly HOT 2
- two resizes into one append
- `toBuffer` silently swallows `stderr`
- How to insert a image into a image HOT 2
- Error: Command failed: gm composite: Unrecognized option (-fill).
- Density option not working
- Icorrect identify info for calculated format "%@" HOT 1
- %@ returns the incorrect trim bounding box.
- Resize raw file lose the metadata exif
- Convert heic image to png failing
- Command failed HOT 2
- Could not execute GraphicsMagick/ImageMagick: '+cmd+" this most likely means the gm/convert binaries can't be found" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gm.