On Wed, Jul 30, 2008 at 10:23:34AM -0500, Drag Sidious wrote:
> Odt writer is making mistakes about images in documents. The big one is that
> it's not calculating the correct size of the image.

Drag,

First of all, thanks for your elaborate report.

> My dirty hack:
> ##############
> 
> It seems that rst2latex gets this right and gets the image sizing correct.
> Maybe you want to look to them and see how it's done.
> 
> But this is my 'fix'::
> 
>    /usr/share/pyshared/docutils/writers/odtwriter$ diff __init__.py init.old

Your patch is in the wrong direction (you swapped original and changed
files).  Apart from that, please provide unified diffs, which can be
used more easily across releases.  You want

        $ diff -u init.old __init__.py

(Of course, I can still use your patch by manually reverting it, no need
to re-submit.  But the above is true for about 99% of all FLOSS
projects, so it can’t hurt knowing it.)

> Hope that makes sense. I am pulling the DPI from the image using the PIL
> library then calculating the size and converting it to centimeters.
> 
> So far this works for me, but I wouldn't be suprised if it causes problems for
> others.

Perhaps there are some image formats that do not provide an embedded DPI
information, for example.  I’ll have a look at how PIL handles such
cases if there are any.

> […]
>
> What may be a better fix to do is fix the restructured text stuff to allow
> users to specify DPI or 'density' of their images. The width and height stuff
> being measured in pixels is misleading since the actual physical size isn't
> ever going to be measured by pixels.  

This sounds better to me indeed.  It could default to the DPI value
stored in the image, but be overriden from the RST source.

This issue will certainly benefit from some pondering, so I’ll take
myself some time (we are in a freeze, after all) to find an appropriate
solution.  Further suggestions are always welcome.

Cheers,
-- 
Michael Schutte <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: Digital signature

Reply via email to