| Author |
Message |
ravensrest

Joined: 22 Feb 2008 Posts: 298 Location: Hood Canal, WA
|
Posted: Thu 21 Jun 2012, 14:32 Post subject:
Using convert -annotate or -append label |
|
Has anyone been able to add text to a picture using convert and the annotate or append label options? I cannot seem to make them work. I get an error whenever I use either that ImageMagick cannot find the requisite font:
| Code: | [~]> convert /data/P1070053.jpg -background Khaki label:'Faerie Dragon' -gravity Center -append /data/test.jpg
convert: /usr/lib/libxml2.so.2: no version information available (required by /usr/lib/libMagickCore.so.3)
CRIT: rangecheck in .setuserparams
Operand stack:
--nostringval-- --nostringval-- --nostringval--
CRIT: rangecheck in .setuserparams
Operand stack:
--nostringval-- --nostringval-- --nostringval--
convert: unable to read font `/usr/lib/ImageMagick-6.6.2/config//usr/share/ghostscript/fontsx/n019003l.pfb' @ error/annotate.c/RenderFreetype/1056.
convert: Postscript delegate failed `/tmp/magick-XX3zrwSq': @ error/ps.c/ReadPSImage/779. |
This and all the other variations of the command string that I've tried produce /data/test.jpg, but there are no labels or annotations on any of them.
Oops, forgot. Have tried this in Puppy431, Slacko53, Wary53 and Racy53.
Thanks for any help you can offer.
BS
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7755 Location: Stratford, Ontario
|
Posted: Thu 21 Jun 2012, 15:27 Post subject:
Re: Using convert -annotate or -append label |
|
| ravensrest wrote: | | /fontsx |
Is that correct or a typo? Because the "fontsx" folder certainly doesn't exist.
BTW, mtPaint can add text to an image, although that might not solve your problem.
[Edit] Try this:
Locate the folder /usr/share/fonts/default/Type1
Copy it into the folder /usr/share/ghostscript.
Rename the new folder as "fontsx".
Run convert with a command like:
| Code: | | convert infile -gravity South -background Plum -splice 0x18 -annotate +0+2 'Hello World' outfile |
|
|
Back to top
|
|
 |
npierce
Joined: 28 Dec 2009 Posts: 637
|
Posted: Thu 21 Jun 2012, 16:54 Post subject:
|
|
Another good catch, rcrsn51.
I just installed imagemagick-6.6.2-6-w5 from the Wary 5 official repository. It contains a configuration file, /usr/lib/ImageMagick-6.6.2/config/type-ghostscript.xml, with 34 references to that non-existent directory (/usr/share/ghostscript/fontsx/).
For me, using Racy 5.2.2, this worked:
| Code: | | ln -s /usr/share/ghostscript/fonts /usr/share/ghostscript/fontsx |
Presumably correcting the configuration file would also work.
(And I see you've also added a solution to your post.)
Modifying ravensrest's command to use an existing file on Racy for a source, like so:
| Code: | | convert /usr/share/pixmaps/smileys.png -background Khaki label:'Faerie Dragon' -gravity Center -append /tmp/test.jpg |
produced this:
| Description |
|
| Filesize |
24.06 KB |
| Viewed |
162 Time(s) |

|
|
|
Back to top
|
|
 |
ravensrest

Joined: 22 Feb 2008 Posts: 298 Location: Hood Canal, WA
|
Posted: Thu 21 Jun 2012, 20:08 Post subject:
|
|
Thank you both.
No, that is not a typo. ImageMagick is looking for fontsfx. Using the symbolic link suggested by npierce worked just fine.
I am continually amazed at the power packed into the various linux commands we use so casually.
Thanks again.
BS
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7755 Location: Stratford, Ontario
|
Posted: Thu 21 Jun 2012, 20:58 Post subject:
|
|
| ravensrest wrote: | | ImageMagick is looking for fontsfx. |
As a test, I compiled ImageMagick from source in Slacko and it still wanted fontsx.
|
|
Back to top
|
|
 |
|