Spaces at beginning of label: disappear...

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Spaces at beginning of label: disappear...

Post by GeeMack »

I copied this over from a discussion in the "Users" section of the forum...
==============================
tunezio wrote:I try to create an image with text and border around the image with a background texture. my problem is that the text is pasted to the edge to the left, and when I try to add a "space" before the text that is ignored but if I add a "space" in the end it works
This is an issue even with a current release ImageMagick 7.0.2-10 running on Windows 10 64. When I run this command to test several labels...

Code: Select all

magick -pointsize 48 ^
   label:"My Text 1 2 3" ^
   label:" My Text 1 2 3 " ^
   label:"\ My Text 1 2 3 " ^
   label:"     My Text 1 2 3     " ^
   label:"\     My Text 1 2 3     " ^
   -bordercolor gray -background gray -border 10x10 -append output.png
... you can see how all the spaces at the beginning of the text string in a "label:" get removed if the first one isn't escaped with a backslash "\".

Image

This may be a bug that needs to be addressed by the developers, or it may just be if a space is the first character in the "label" it needs to be escaped to make it work.
==============================
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Spaces at beginning of label: disappear...

Post by snibgo »

This is a change of behaviour. In v6.9.5-5, I get the same bad result as GeeMack. I call it a bug, because there seems no good reason for the change.

Under v6.9.2-5, I get the correct behaviour:
Image
snibgo's IM pages: im.snibgo.com
Post Reply