Applied the patch from Matthias Basler attached to bug #7288,
without the rename of x and y variables to minimize the diff.
Code reviewed for correctness and retested manually.
Further work needed (probably on the master branch only):
1) DPI default of 96 -- need to verify platform independence
2) Proper refactoring of the code into ODF-specific pieces
and image manipulation that should go down into ImgManip.py