Outline bug with stroke

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
Dombi
Posts: 12
Joined: 2015-03-19T02:36:45-07:00
Authentication code: 6789

Outline bug with stroke

Post by Dombi »

Hello from Germany again.

I use ImageMagick 6.8.9-9 and I want create an outline text. But after a few letters this (see the picture) happens:
https://www.servietten-deko.de/images/outline.png

These are my code lines:

Code: Select all

$stokewidthcmd=' -strokewidth '.$this->padding.' -stroke "#'.$this->outlinecolor.'"';

system('convert -depth '.$this->imagedepth.' -density '.$this->dpi.' -units pixelsperinch -background transparent -gravity '.$this->gravity.' -fill "#'.$this->fore.'" -font '.$this->font' -strokewidth '.$this->padding.' -stroke "#'.$this->outlinecolor.'" ' -pointsize '.$this->size.' label:"'.$this->msg.'" '.WWW_ROOT.IMAGES_URL.'editorimages/1_'.$pngName);

system('composite -gravity center '.WWW_ROOT.IMAGES_URL.'editorimages/'.$pngName.' '.WWW_ROOT.IMAGES_URL.'editorimages/1_'.$pngName.' '.WWW_ROOT.IMAGES_URL.'editorimages/'.$pngName);
Here you can try it live (press the great buttan then create a new text with outline/Umrandung):
https://www.servietten-deko.de/servietten-bedrucken.php

Can someone please help me?

PS: Sorry for my bad english.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Outline bug with stroke

Post by fmw42 »

When using label: and putting two text colors, try using -gravity center
Dombi
Posts: 12
Joined: 2015-03-19T02:36:45-07:00
Authentication code: 6789

Re: Outline bug with stroke

Post by Dombi »

Thank you. But in line 2 and 3 is a "-gravity center"
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Outline bug with stroke

Post by Bonzo »

Have you tried a simple piece of code with fixed values to see what the result is?
Dombi
Posts: 12
Joined: 2015-03-19T02:36:45-07:00
Authentication code: 6789

Re: Outline bug with stroke

Post by Dombi »

Yes i tried:

Code: Select all

system('convert -depth 32 -density 300 -units pixelsperinch -background transparent -gravity center -fill "#ffffff" -font arial -strokewidth 2 -stroke "#006abc" -pointsize 4 label:"fgdfg fdgfdgggggggg" '.WWW_ROOT.IMAGES_URL.'editorimages/1_'.$pngName);
... same result.

If I change the font, then the error comes earlier or later in the text.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Outline bug with stroke

Post by Bonzo »

I do not see how you can tell at -pointsize 4 :D

Anyway works OK for me with -pointsize 10 & 20 in whatever version of convert I have in V7; also worked OK using magick. I suppose the suggestion will be to upgrade or try a different version.

Should also say I used the command line.
Dombi
Posts: 12
Joined: 2015-03-19T02:36:45-07:00
Authentication code: 6789

Re: Outline bug with stroke

Post by Dombi »

I cant change the version. My provider decides this. Here it is ImageMagick 6.8.9-9 Q16.

PS: -pointsize 4 is a good size. 20 is very big, here.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Outline bug with stroke

Post by Bonzo »

Just tried it on my server ( Version: ImageMagick 6.9.4-10 Q16 x86_64 2017-05-23 ) as well and it works OK - you might have a problem if you can not get your hosts to upgrade.

Image

With -pointsize 4 I was just getting blue blobs.
Dombi
Posts: 12
Joined: 2015-03-19T02:36:45-07:00
Authentication code: 6789

Re: Outline bug with stroke

Post by Dombi »

Thank you. But I found the solution:

The line only works without the "-units pixelsperinch" tag. Strange, but true. :-)
Post Reply