wttr.in icon indicating copy to clipboard operation
wttr.in copied to clipboard

Fix PNG rendering

Open chubin opened this issue 2 years ago • 17 comments
trafficstars

PNG rendering is temporary disabled.

$ curl wttr.in/Nuremberg.png
PNG support temporary disabled

chubin avatar Sep 25 '23 22:09 chubin

Same issue for me :)

edi9999 avatar Sep 29 '23 07:09 edi9999

same issue here too

truerico avatar Oct 04 '23 20:10 truerico

same

lecoxsportif avatar Oct 11 '23 03:10 lecoxsportif

Any idea why was it disabled?

morfeus2 avatar Oct 15 '23 17:10 morfeus2

Can't find any info on why it has been disabled, is this only the png image or emojis too?

Intellek-help avatar Oct 16 '23 15:10 Intellek-help

Here is what I use now as a replacement :

img="$(mktemp /tmp/weather_XXXX.png)"
textimg -i "$(curl --silent "wttr.in/$town?q")" -F 30 -o "$img"
ristretto "$img"

textimg can be installed here : go install github.com/jiro4989/textimg/v3@latest

edi9999 avatar Oct 17 '23 10:10 edi9999

is there any update on this

liam8888999 avatar Nov 10 '23 12:11 liam8888999

I started porting the existing Python implementation to Go (the Python implementation is too slow for the current load level). Let me know if you want to help

chubin avatar Nov 12 '23 15:11 chubin

I started porting the existing Python implementation to Go (the Python implementation is too slow for the current load level). Let me know if you want to help

@chubin edi9999 metioned https://github.com/jiro4989/textimg in his workaround, which seems a good module for ANSI text to PNG conversion.

nirvam avatar Nov 14 '23 06:11 nirvam

I've skimmed through it, and it seems to be pretty fit for our needs. It has emoji support, wide runes, true colors, etc. I will play with it, and check how easy it could be integrated

chubin avatar Nov 14 '23 07:11 chubin

The only bug I had so far was when there was a "thunderstorm alert". In the terminal, it shows as an animated "thunder" icon. In that case, the PNG output had some strange chafracters with textimg.

But that was the only issue I had in several weeks of usage.

edi9999 avatar Nov 14 '23 07:11 edi9999

I started porting the existing Python implementation to Go (the Python implementation is too slow for the current load level). Let me know if you want to help

Now I understand, good to know the motivation. Unfortunately I don't know Go at all, otherwise I would have offered my help.

morfeus2 avatar Nov 14 '23 08:11 morfeus2

@chubin edi9999 metioned https://github.com/jiro4989/textimg in his workaround, which seems a good module for ANSI text to PNG conversion.

I've skimmed through it, and it seems to be pretty fit for our needs. It has emoji support, wide runes, true colors, etc. I will play with it, and check how easy it could be integrated

Seems great and efficient for v1 output. I couldn't make it work with the v2 output though (only the weather icons worked well but not the graph itself). If anyone else managed to make it work, please share.

ivan-ristovic avatar Nov 15 '23 19:11 ivan-ristovic

Yes indeed, with the v2 output the textimg software doesn't give the right output ... (for the graph)

edi9999 avatar Nov 20 '23 08:11 edi9999

For example, the thunderstorm output is buggy with the textimg utility :

image

edi9999 avatar Dec 29 '23 14:12 edi9999

Is there any progres on this issue?

sholl avatar May 03 '24 18:05 sholl