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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
William.Audet
Posts: 2
Joined: 2019-01-28T06:49:11-07:00
Authentication code: 1152

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

Post 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!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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
snibgo's IM pages: im.snibgo.com
William.Audet
Posts: 2
Joined: 2019-01-28T06:49:11-07:00
Authentication code: 1152

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

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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/
snibgo's IM pages: im.snibgo.com
Post Reply