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

Error: Command failed: convert: unrecognized dither method `-background' #112

Closed
GoodnessJSON opened this issue Feb 22, 2024 · 8 comments
Closed

Comments

@GoodnessJSON
Copy link

GoodnessJSON commented Feb 22, 2024

Hi there,

Just updated to v1.0.7 and love the new configs. Unfortunately the add-on now crashes with every start with this error:

Converting rendered screenshot of http://192.168.1.50:8123/dashboard-kindle/0?kiosk to grayscale png...
/app/node_modules/gm/lib/command.js:301
          err = new Error('Command failed: ' + stderr);
                ^

Error: Command failed: convert: unrecognized dither method `-background' @ error/convert.c/ConvertImageCommand/1422.

    at ChildProcess.onExit (/app/node_modules/gm/lib/command.js:301:17)
    at ChildProcess.emit (node:events:517:28)
    at maybeClose (node:internal/child_process:1098:16)
    at Socket.<anonymous> (node:internal/child_process:450:11)
    at Socket.emit (node:events:517:28)
    at Pipe.<anonymous> (node:net:350:12) {
  code: 1,
  signal: null
}

I've tried toggling the Dither and Gamma settings but it makes no difference. Can this be looked at? Thanks so much for the great project!

@andyb2000
Copy link

Yep, spotted this after testing and talking to @sibbl about another issue with env's so looks like it's due to the line 308 in index.js ( .dither(pageConfig.dither))

I may get time tomorrow to take a quick look.

@GoodnessJSON
Copy link
Author

Yep, spotted this after testing and talking to @sibbl about another issue with env's so looks like it's due to the line 308 in index.js ( .dither(pageConfig.dither))

I may get time tomorrow to take a quick look.

That would be amazing, thanks for taking a look!

@sibbl
Copy link
Owner

sibbl commented Feb 23, 2024

The cause of this might be that our Dockerfile uses imagemagick instead of graphicsmagick. While the used npm module gm says to be compatible with both, it doesn't seem to support the differences in the dither parameter. While +dither works for both, the -dither parameter requires the name of the dither algorithm to use in imagemagick, while graphicsmagick only uses it as a toggle.

Maybe it's worth to give Graphicsmagick another try in the Dockerfile but I'm not sure what other incompatibilities will occur.
An alternative would be to open an issue in the gm npm package repository.
Finally, we could also just use the "custom arguments" feature of the gm npm package to support -dither ALGORITHM and ´+dither` by our own. That's probably what I'd prefer.

@GoodnessJSON
Copy link
Author

GoodnessJSON commented Feb 23, 2024

This only seemed to come with the update to Home Assistant yesterday, as well as the v1.0.7 update today. I'm not sure if that helps at all. Node.js v18.19.1 running HAOS on a RPB4.

@sibbl
Copy link
Owner

sibbl commented Feb 23, 2024

Oh, now I understand. After the update, it doesn't work either way - with and without the toggle? I thought it was just a problem after enabling it.

As a quick fix, I'll remove the option again until we can find out the real cause. Version 1.0.8 will be available in a few minutes.

@GoodnessJSON
Copy link
Author

Oh, now I understand. After the update, it doesn't work either way - with and without the toggle? I thought it was just a problem after enabling it.

As a quick fix, I'll remove the option again until we can find out the real cause. Version 1.0.8 will be available in a few minutes.

Yep that's correct! No matter the setting, or after reinstalling it's the same error. Thanks for taking a look! Will let you know about v1.0.8. Thanks for the quick responses!

@GoodnessJSON
Copy link
Author

Can confirm this has now fixed it. Great work!

@sibbl
Copy link
Owner

sibbl commented Feb 23, 2024

Thanks for the confirmation and sorry that it happened in the first place!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants