On Fri, 12 Jul 2013 14:15:29 -0400
Steve Litt <sl...@troubleshooters.com> wrote:

> Hi all,
> 
> Ugh! In my original document the images were all in the images
> directory below the current directory (./images). Look what the LyX
> native LyXHTML export did to them:
> 
> <img src='0_d_at_python_lyx2epub_images_divcon.gif' alt='image:
> 0_d_at_python_lyx2epub_images_divcon.gif' />
> 
> <img src='1_d_at_python_lyx2epub_images_electrical_system.gif'
> alt='image: 1_d_at_python_lyx2epub_images_electrical_system.gif' />
> 
> <img src='2_d_at_python_lyx2epub_images_rad_bad.gif' alt='image:
> 2_d_at_python_lyx2epub_images_rad_bad.gif' />
> 
> They were all put in the current directory.
> 
> I think I understand the design intent of doing it this way -- the LyX
> file could have pulled images from all over the hard disk, including
> absolute paths, and you can't have an HTML file create directories.
> But this is seriously ugly, and rather difficult to change the LyX
> original ./images/divcon.gif into ./images/divcon.gif in the current
> directory of the XHTML file.
> 
> I might put a config option in my filter to
> remove ?_d_at_python_lyx2epub_images_ and replace it
> with ./myimagedirectory/. Anyone have ideas?
> 
> Thanks,
> 
> SteveT
> 
> Steve Litt                *  http://www.troubleshooters.com/
> Troubleshooting Training  *  Human Performance

Steve,

I've run across the same problem myself. It's fixable with a little bit
of sed and/or a few lines of Perl or awk.

However, perhaps the ideal would be to default to a separate images
directory in the current directory, putting all images in that
directory no matter where they come from, and solving the obvious
possibility of duplicate names when images come from different sources
by adding '_1', '_2', etc., to the base name of a file when there is
already one with that name in the images directory.

Even if this is the default, the current solution may be preffered in
some cases, so the choice should be given (perhaps in a Preferences
setting).

Les

Reply via email to