Joao B. Oliveira wrote:
> Well, not really. It is rather common (at least here) to put
> several smaller images in a figure, to draw comparisons like "In
> Fig 6a you see this, and in 6b we clearly see that, but 6c clearly
> shows...". Sometimes we put four or six smaller EPS imagens in a
> figure. (And it does not look that bad :)
> 
>> > -- First of all, how does the conversion/display process really
>> > works? Specially, how EPS files are handled? (I understand that
>> > they are always converted to ppm for displaying? Why ppm?)
>> 
>> By default, we use ImageMagick's 'convert' program, run through a script
>> convertDefault.sh. I too find that 'convert' is very slow. (But this
>> shouldn't really matter. See above.)
> 
> I have used LyX in -dbg mode and checked the conversion process. It
> does not seem that LyX itself is doing things badly, but it calls
> convert for every image on the current screen and convert seems to
> be doing a bad job, taking up all memory and filling the swap area
> as well.

Sure, at the moment shell scripts are generated for each single conversion 
process. These conversions therefore execute in parallel. One possible 
improvement would be to gather all images on the screen into a list and 
send the list to a shell script for conversion and the conversions would 
execute in series.

Another possible improvement, tied to this, would be to enable communication 
between LyX and the conversion script so that individual images in this 
list of many images could be loaded by LyX as they become available. At the 
moment, LyX only receives notification that the shell script has finished, 
which it uses as a flag to try and load the .png or .ppm file.

Finally, if we enable LyX to use pipes to communicate with the shell script, 
Dekel's suggestion of loading the image from stdout rather than from a file 
written to disk becomes possible also.

>> I attach a modified convertDefault.sh that uses ghostscript to convert
>> eps files to either ppm or png format. Personally, I would use it as the
>> basis for a my_ps2ppm or my_ps2png converter...
> 
> Thank you! As some initial tests are showing, using gs directly
> seems to be significantly more efficient than convert. Maybe this
> was the reason for most of our problems all along. I'll invest on
> that in the next days. To begin, comparing the shell script you
> sent (that is, gs) with the traditional convert, regarding time
> and memory consumption...

Note that sometimes gs refuses to convert postscript files to bitmap format. 
However, it will happily 'fix' such problem files if you run them through 
eps2eps and thereafter has no problems at all.

Personally, I prefer using individual converters of the form
        \converter "eps" "png" "sh /home/angus/bin/my_ps2png $$i $$o" ""
rather than a catch-all like convertDefault.sh. You could easily add such 
converters to the /usr/share/lyx/scripts directory together with converter 
definitions in the global /usr/share/lyx/lyxrc.defaults file and your users 
will all benefit.

-- 
Angus

Reply via email to