Page 1 of 1

Adding Windows computer name and Windows image version to Wallpaper.jpg

Posted: 2019-01-28T14:49:51-07:00
by William.Audet
Hello! What I am trying to accomplish with ImageMagick is to take a default Wallpaper.jpg file which is saved locally on a Windows 10 computer, and then customizing it by adding text at the bottom centre of the image, such as the computer name and windows image version. I searched online and couldn't find an answer, I need your help, how can I get this done? This would be used on our corporate domain computers to help users quickly identify which computer they're working on.
Thank you!

Re: Adding Windows computer name and Windows image version to Wallpaper.jpg

Posted: 2019-01-28T15:02:41-07:00
by snibgo
In Windows, the computer name is stored in an environment variable COMPUTERNAME. I have no idea where the "windows image version" comes from.

Your IM command could be:

Code: Select all

magick in.jpg -pointsize 30 -gravity South -annotate 0 "%COMPUTERNAME%" out.jpg

Re: Adding Windows computer name and Windows image version to Wallpaper.jpg

Posted: 2019-01-29T06:47:17-07:00
by William.Audet
Hello snigbo, thank you for your response! What we plan on doing for the ''image version'' regarding patch level updates, perhaps the computer could have a text file at c:\os-updates.txt, is it possible for ImageMagick to read the content of that os-updates.txt file and write it to the out.jpg?

Re: Adding Windows computer name and Windows image version to Wallpaper.jpg

Posted: 2019-01-29T12:34:28-07:00
by snibgo
When a command writes text, eg "-annotate", "label:" and "caption:", the text can be in a file, and you use the file name prefixed with "@" in the command. See examples in http://www.imagemagick.org/Usage/text/