In sending webcam image to Meteobridge.com I'd like to know how to send a line break in the image text. I tried \n but the backslash gets removed when I save changes.
I've managed to make the rectangle taller to accommodate the extra line. I just can't figure how to send the line break. Once I figure this out I'll be able to fit more weather data like my PM2.5 sensor which doesn't fit with everything else there now.
My Overlay text is:
-resize 852x480 -fill black -draw "fill-opacity 0.7 rectangle 0 460 852 480" -pointsize 12 -fill orange -draw "text 5 475 '[YYYY]-[MM]-[DD] [hh]:[mm]'" -fill white -draw "text 110 475 'Temp: [th0temp-act=F.1:--] °F Humidity: [th0hum-act.0:--] % Pressure: [thb0seapress-act=inhg.2:--] inHg Wind Chill: [wind0chill-act=F.1:--]°F Wind: [wind0avgwind-act=mph.1:--] mph Gust: [wind0wind-max5=mph.1:--] mph Rain today: [rain0total-sumday=in.2:--] in'"
How do I send a line break (new line) in webcam text **solved**
Moderator: Mattk
How do I send a line break (new line) in webcam text **solved**
Meteobridge RPI | GW1000
Re: How do I send a line break (new line) in webcam text
Well I figured it out by taking a different approach. Instead of sending a line break I just changed the code to send out two separate lines.
It works...but would be simpler if someone could figure out how to add a line break.
-resize 852x480 -fill black -draw "fill-opacity 0.7 rectangle 0 440 852 480" -pointsize 12 -fill orange -draw "text 5 455 '[YYYY]-[MM]-[DD] [hh]:[mm]'" -fill white -draw "text 110 455 'Temp: [th0temp-act=F.1:--] °F Humidity: [th0hum-act.0:--] % Pressure: [thb0seapress-act=inhg.2:--] inHg Wind Chill: [wind0chill-act=F.1:--]°F Wind: [wind0avgwind-act=mph.1:--] mph Gust: [wind0wind-max5=mph.1:--] mph'" -fill white -draw "text 110 475 'Rain today: [rain0total-sumday=in.2:--] in Air Quality PM2.5: [air0pm-max5=.0] μg/m3'"
It works...but would be simpler if someone could figure out how to add a line break.
-resize 852x480 -fill black -draw "fill-opacity 0.7 rectangle 0 440 852 480" -pointsize 12 -fill orange -draw "text 5 455 '[YYYY]-[MM]-[DD] [hh]:[mm]'" -fill white -draw "text 110 455 'Temp: [th0temp-act=F.1:--] °F Humidity: [th0hum-act.0:--] % Pressure: [thb0seapress-act=inhg.2:--] inHg Wind Chill: [wind0chill-act=F.1:--]°F Wind: [wind0avgwind-act=mph.1:--] mph Gust: [wind0wind-max5=mph.1:--] mph'" -fill white -draw "text 110 475 'Rain today: [rain0total-sumday=in.2:--] in Air Quality PM2.5: [air0pm-max5=.0] μg/m3'"
Last edited by galfert on Sat Mar 07, 2020 5:35 am, edited 1 time in total.
Meteobridge RPI | GW1000
Re: How do I send a line break (new line) in webcam text
Annotations are done with imagemagick. Regarding line breaks in texts here are some examples:
http://www.imagemagick.org/Usage/text/
In Meteobridge it might need a double quoting like \\n instead of just \n.
But to be honest, I never tried this.
http://www.imagemagick.org/Usage/text/
In Meteobridge it might need a double quoting like \\n instead of just \n.
But to be honest, I never tried this.
Re: How do I send a line break (new line) in webcam text
I tried the \n with multiple \\ and it still doesn't work. Do you know the version of ImageMagick used by the Meteobridge?
I did read the following over at ImageMagick...
As of IM version 6.2.4, the "-draw text" operation no longer understands the use of '\n' as meaning newline, or the use of percent '%' image information escapes. These abilities, and problems, however remain available in the new IM v6 operator "-annotate"
I did read the following over at ImageMagick...
As of IM version 6.2.4, the "-draw text" operation no longer understands the use of '\n' as meaning newline, or the use of percent '%' image information escapes. These abilities, and problems, however remain available in the new IM v6 operator "-annotate"
Meteobridge RPI | GW1000
Re: How do I send a line break (new line) in webcam text
Version: ImageMagick 6.8.9-9 Q16 x86_64 2019-11-12
Re: How do I send a line break (new line) in webcam text
Thank you for the version information. I guess this settles the matter then. You can't use the \n for line break with the -draw function. The alternative is to do what I've done above and just -draw each line separately or use the -annotate function which looks like it has different syntax and needs to be figured out to be used properly, but then the line break is possible.
**Solved**
**Solved**

Meteobridge RPI | GW1000
Re: How do I send a line break (new line) in webcam text **solved**
Thanks for sharing your insight and research results.