On 02/04/2011 12:28 PM, Rob Oakes wrote:
Dear LyX Developers and Users,

I've been playing with using LyX as a way to create both print PDFs and ePub 
documents from a single source document. So far, everything works very, very 
well. (The XHMTL is extremely clean and easy to modify by tweaking the CSS.) 
What is not easy, however, is the management of images.  For print, it is 
necessary to have high resolution images (300 dpi +), but for eReaders, the 
images should be sized for screen (72 dpi).

Does anyone know if it is possible to resize JPEG and PNG images at the time of 
HTML export?

At present, this is an unfinished bit of work. Unfortunately, it isn't as easy as I'd hoped, since the preview routines don't actually do this conversion themselves, but rely upon QImage, if I remember right. So some new code is needed that would calls ImageMagick with the right parameters. I don't think that would be terribly hard, but my main focus is presently on bug squashing and, when I've time, on finishing the math export.

If there is no way to resize images, then would it be possible to specify the height 
and width dimensions in the<IMG>  tag? This data is already present in the 
document (as it is being fed as LaTeX parameters). Could it be translated to HTML 
equivalents? Most browsers know how to respect the same units as LaTeX.

This would be pretty simple, yes, and I think we already do some such translation.

If not currently supported, would this be a very complicated addition to the 
existing code, might it be possible to submit a patch (now that we're in beta 
testing)? If not too complicated, I would be happy to take a stab at 
implementing a patch. (Unfortunately, I'm not very familiar with the HTML code.)

The width and height tags should just be output in the InsetGraphics::xhtml() routine, and it should be pretty clear where.

Richard

Reply via email to