Skip to content

Reading image data from stdin raises "Failed to open '-': Unknown file format" error on Windows build #100

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

Closed
TransparentLC opened this issue Jul 29, 2022 · 2 comments

Comments

@TransparentLC
Copy link

Just tried using - as input file and found this difference. It seems that Windows build can't treat - as "reading image data from stdin".

Tested on version 1.8.0 for WSL Ubuntu 22.04 installed by apt and version 1.12.3 for Windows downloaded from project homepage and I'm sure the image isn't corrupted.

curl "https://picsum.photos/id/128/30/20.webp" -L --output - | chafa -

屏幕截图 2022-07-29 200459

屏幕截图 2022-07-29 200509

@hpjansson
Copy link
Owner

Hi, thanks for reporting this issue! I've verified that it happens here too (Win10 PowerShell + scoop), and am working on a fix.

@hpjansson
Copy link
Owner

All that was needed in this instance was to enable binary mode on stdin.

For my own future reference, Chris Wellons has a very nice and up-to-date summary of things one can do to sort of paper over the worst issues of the Windows platform.

There may be other Windows-specific bugs. If you find any more, I'd love to hear about them.

hpjansson added a commit that referenced this issue May 21, 2023
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

2 participants