MSYS2-packages icon indicating copy to clipboard operation
MSYS2-packages copied to clipboard

[Feature Request] libqrencode: enable PNG output support

Open thenktor opened this issue 3 years ago • 25 comments

Describe the bug

When using qrencode to write a png it says PNG output is disabled at compile time. No output generated.

It would be nice to be able to write PNG files instead of XPM, because PNG is a widely supported format while XPM is not.

thenktor avatar Oct 28 '20 15:10 thenktor

Any updates on this?

rollingmoai avatar Jul 17 '22 06:07 rollingmoai

Would you like to use a mingw version of the package? libpng is available in mingw packages.

Biswa96 avatar Jul 17 '22 08:07 Biswa96

Would you like to use a mingw version of the package? libpng is available in mingw packages.

The MinGW version currently has a bug where utf8 and ANSI types do not display correctly (https://github.com/fukuchi/libqrencode/issues/200), while the MSYS version does. So I would like to use the MSYS version for a while, at least until the bug is fixed.

rollingmoai avatar Jul 17 '22 08:07 rollingmoai

That issue can be reproduced in cmd but not in mintty. Here is a screenshot in mintty.

image

Biswa96 avatar Jul 17 '22 12:07 Biswa96

That issue can be reproduced in cmd but not in mintty. Here is a screenshot in mintty.

image

Can confirm. Still an annoying bug, though. I use msys in Windows Terminal.

rollingmoai avatar Jul 17 '22 12:07 rollingmoai

You can use something like ImageMagick or Inkscape as a workaround to convert a resulting SVG to a PNG. But I agree, it would be great to have it on MSYS.

sitiom avatar Jul 17 '22 12:07 sitiom

I have used qrencode in bare metal Linux installation and it works perfect in both ansi256 and utf8 mode. The issue is in the Windows conhost. I slightly remember some similar issues with other programs in microsoft/terminal and mintty/mintty repositories. It goes something like conhost do its own text processing instead of handling over it to terminal emulators.

Biswa96 avatar Jul 17 '22 12:07 Biswa96

On the latest preview of Windows Terminal, both ANSI and UTF8 outputs work in the mingw package:

image

image

rashil2000 avatar Jul 17 '22 13:07 rashil2000

Many programs don't work in conhost, but they do in Windows Terminal. Conhost does not get all the fixes/patches that Windows Terminal gets because it's an internal component.

rashil2000 avatar Jul 17 '22 13:07 rashil2000

Many programs don't work in conhost

Some still work on conhost, though. I'm not sure whether the program should fixed to be compatible with conhost or the problem be fixed on conhost's side.

sitiom avatar Jul 17 '22 13:07 sitiom

the problem be fixed on conhost's side.

I wouldn't bet on this. Microsoft itself heavily discourages use of conhost because of these bugs and the general lack of extensibility of conhost. They're all in on the new Terminal.

rashil2000 avatar Jul 17 '22 13:07 rashil2000

On the latest preview of Windows Terminal, both ANSI and UTF8 outputs work in the mingw package:

image

image

@rashil2000 Just tested in the latest Windows Terminal preview. It doesn't work for me though: image image

sitiom avatar Jul 17 '22 15:07 sitiom

What's your $OutputEncoding?

rashil2000 avatar Jul 17 '22 16:07 rashil2000

What's your $OutputEncoding?

Here: image

sitiom avatar Jul 17 '22 16:07 sitiom

Strange, what's your build number? Mine's 10.0.25158.1000

rashil2000 avatar Jul 17 '22 16:07 rashil2000

Strange, what's your build number? Mine's 10.0.25158.1000

Mine is 10.0.22000.795. Are you on an insider build? Is it fixed in conhost or Windows Terminal Stable in there?

sitiom avatar Jul 17 '22 17:07 sitiom

I'm on the Insider build.

Is it fixed in conhost or Windows Terminal Stable in there?

I have no idea 😅

rashil2000 avatar Jul 17 '22 17:07 rashil2000

I'm already in the beta insider, and it still doesn't work. Time to switch to the Dev Channel

sitiom avatar Jul 18 '22 05:07 sitiom

@rashil2000 I'm in the same build as you now. Still doesn't work.

sitiom avatar Jul 18 '22 05:07 sitiom

Maybe it has something to do with terminal's settings? My settings file is here.

rashil2000 avatar Jul 18 '22 06:07 rashil2000

Maybe it has something to do with terminal's settings? My settings file is here.

I used your config, and it still doesn't work for some reason. Can you trace what makes it work on your end (e.g., try default settings, Test Windows Terminal Stable or conhost)?

sitiom avatar Jul 18 '22 07:07 sitiom

In conhost, UTF8 works but ANSI doesn't.

I've tested these shells with the given parameters to confirm that I don't have any interfering settings:

cmd /d
pwsh.exe -NoProfile
powershell.exe -NoProfile

rashil2000 avatar Jul 18 '22 08:07 rashil2000

One final thing: do you have this checkbox (at the bottom) checked?

image

rashil2000 avatar Jul 18 '22 08:07 rashil2000

One final thing: do you have this checkbox (at the bottom) checked?

image

Oh nice, enabling it fixed the problem. UTF8 works on conhost now but still not ANSI: image

What does that feature exactly do anyway?

sitiom avatar Jul 18 '22 08:07 sitiom

It enables support for new Unicode codepoints (UTF8 only).

rashil2000 avatar Jul 18 '22 08:07 rashil2000