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.
Dombi
Posts: 12 Joined: 2015-03-19T02:36:45-07:00
Authentication code: 6789
Post
by Dombi » 2017-08-02T05:21:44-07:00
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.
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2017-08-02T09:43:03-07:00
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
Post
by Dombi » 2017-08-02T12:12:28-07:00
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
Post
by Bonzo » 2017-08-02T12:31:31-07:00
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
Post
by Dombi » 2017-08-02T13:27:54-07:00
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
Post
by Bonzo » 2017-08-02T13:37:04-07:00
I do not see how you can tell at -pointsize 4
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
Post
by Dombi » 2017-08-02T13:45:50-07:00
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
Post
by Bonzo » 2017-08-02T14:12:32-07:00
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.
With -pointsize 4 I was just getting blue blobs.
Dombi
Posts: 12 Joined: 2015-03-19T02:36:45-07:00
Authentication code: 6789
Post
by Dombi » 2017-08-03T05:46:52-07:00
Thank you. But I found the solution:
The line only works without the "-units pixelsperinch" tag. Strange, but true.