Chris Bainbridge wrote:

> Hi there, I'm having a problem with lyx 1.2.3 on gentoo linux. When I try
> to insert a graphic (.png,.ps,.eps,.xpm) I get:
> 
> In InitColorLookup [rgb_db.c 85] can't find the rgb color database--No
> such file or directory
> In LookupColor [rgb_db.c 177] database uninitialized
> ... repeated many times
> 
> When I then scroll down to see the inserted graphic I get:
> 
> Received unhandled X11 event
> Type: 0xd Target: 0x3600064
> In InitColorLookup [rgb_db.c 85] can't find the rgb color database--No
> such file or directory
> In LookupColor [rgb_db.c 177] database uninitialized
> ... repeated many times
> 
> and a black box is rendered!
> 
> If I try to insert a .gif graphic it works as expected. I have used
> convert to get png from my .ps and then loaded it into gimp and the
> picture is ok. The .ps and .eps files render in gv and kghostview fine. In
> lyx they are just rendered as a filled black box, and the error message
> above is given many times. When I try to "view->postscript" from lyx the
> images are include ok. I've just rebuilt lyx and still have the problem.
> 
> Any help in solving this would be appreciated.

Hello Chris. This is an error message from the XPM image loader in the 
xforms library. It is unable to find a file rgb.txt that is part of the 
standard X11 distribution. Try this at the console to find it:
$ find / -name rgb.txt

It's a database containing entries like:
255 250 250             snow
 25  25 112             MidnightBlue
210 105  30             chocolate
178  34  34             firebrick

xforms is braindead in this regard; the possible location of the file is 
hard-coded as 
/usr/lib/X11/rgb.txt, 
/usr/X11R6/lib/X11/rgb.txt,
/usr/local/lib/X11/rgb.txt,
/usr/openwin/lib/rgb.txt,
/XFree86/lib/X11/rgb.txt

So, you'll need to create a symbolic link from your file to one of these 
locations. If the file does not exist (v. unlikely) then your system is 
probably hosed anyway.

If you continue to have problems when converting to xpm format, finding it 
impossible to display your images, then you've probably come up against a 
bug in ImageMagick's 'convert' programm that is (probably) doing the grunt 
work of the conversion process. Run

$ lyx -dbg graphics

to see exactly what is going on (a script is launched to do the conversion 
external to LyX). If 'convert' is doing the work and you are still 
suffering, then I'd suggest defining some converters explicitly (using the 
Conversion tab of the Preferences dialog). xforms loads ppm files without 
any known problems, so converters of the form

\converter "eps" "ppm" "convert eps:$$i ppm:$$o" ""

(stored in you $HOME/.lyx/preferences file) should do the trick.

HTH
-- 
Angus

Reply via email to