-
Notifications
You must be signed in to change notification settings - Fork 40
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
Error: Stream yields empty buffer #13
Comments
Hello Alex, Cheers, |
I found the issue. Running Here's my
Any ideas how I can force |
Hello Alex, Cheers, |
Windows 7 x64, Node 20.2.0 $ smartcrop --width 100 --height 100 out.jpg out-t.jpg
Error: Stream yields empty buffer
at Socket.<anonymous> (C:\Node\node_modules\smartcrop-cli\node_modules\gm\lib\command.js:56:21)
at Socket.emit (node:events:523:35)
at endReadableNT (node:internal/streams/readable:1367:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) If this is related to |
@sergeevabc what magick version are you running? |
@jwagner, the latest one. Point is that Windows has its own $ where convert.exe
C:\Windows\System32\convert.exe
C:\Apps\Media\IM\convert.exe
$ where magick.exe
C:\Apps\Media\IM\magick.exe |
Thanks for the explanation. It's been a long time since I've done any software development on windows. Could you check to see if changing https://github.com/jwagner/smartcrop-cli/blob/master/smartcrop-cli.js#L53 from
to
resolves the issue? If it doesn't we'd need to add an option to pass in the app path via an argument. You could test that like this
|
var gm = require('gm').subClass({ imageMagick: '7+' }); and var gm = require('gm').subClass({
appPath: String.raw`C:\Apps\Media\IM\magick.exe`
}); did not bring relief, the error is the same $ smartcrop --width 100 --height 100 in.png out.png
Error: Stream yields empty buffer
at Socket.<anonymous> (C:\Node\node_modules\smartcrop-cli\node_modules\gm\lib\command.js:56:21)
at Socket.emit (node:events:523:35)
at endReadableNT (node:internal/streams/readable:1367:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) |
Maybe that's because the GM module is outdated. The constraint in the package.json is Does the GM package work for you (outside of smartcrop-cli)? Edit: Just one more random idea, maybe
would work. |
I installed the package and tried a basic command, but there was no output at all. $ npm install gm -g
$ node -e "const gm = require('gm').subClass({appPath: String.raw`C:\im\magick.exe`}); gm('c:\im\in.png').identify();" At least the following one still works as expected $ node -e "console.log('Hello, world!')"
Hello, world! |
To get some output you need to log something:
|
Some good news, Jonas. var gm = require('gm').subClass({
appPath: String.raw`C:\im\magick.exe`
});
gm(String.raw`c:\in.png`).identify(function (err, data) {
console.log(err, data)
}); threw an error as follows
However, this one finally worked. var gm = require('gm').subClass({
imageMagick: '7+'
});
gm(String.raw`c:\in.png`).identify(function (err, data) {
console.log(err, data)
}); Alas, I don't know what to do next, because we've already tried to put |
node: v7.10.0
npm: v5.0.0
The text was updated successfully, but these errors were encountered: