[Libreoffice-bugs] [Bug 92796] [ODF] Writer does not remove unused page background image/bitmap

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Jan 24 14:58:41 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=92796

--- Comment #18 from ajlittoz <page74010-sf at yahoo.fr> ---
Unaware of this bug report, I investigated on this incorrect behaviour after a
question on the French leg of AskLibO.

I experimented with .fodt files. From my analysis, the culprit could be in the
page style definition (section <office:automatic-styles> in the XML). The
modified page style is described by an XML element <style:page-layout
style:name="pm1"> (of course, the exact name does not matter).

Initially, we have attribute draw:fill="none".

When we add a background image, the attribute turns to draw:fill="bitmap" with
tons of additional attributes to describe image placement and repetition. A
draw:fill-image-name="xxx" is also created with the image data stored in
section <office:styles> as a record <draw:fill-image draw:name="xxx"> with
binary image data.

First question: why is binary image data duplicated in <style:page-layout
style:name="pm1"> ? Since there is reference to the image store, this
duplication prevents image sharing and contributes to file size inflation.

Then I reverted to no brackground. Attribute draw:fill is correctly reverted to
value "none". Binary image data is deleted BUT draw:fill-image-name="xxx" is
kept!

If there is a reference counter in the image store, this counter can't go to
zero and this could be the reason why the image remains in the store.

Second question: why is attribute draw:fill-image-name not deleted when we
choose another background then bitmap?

I then tried to remove manually the image from the UI. In the Area tab of the
page style dialog, bitmap mode, i clicked on the image in the left pane to
select it. I right-clicked the selected image and chose Delete from the menu.
The image is no longer displayed in the pane, even after exiting and reloading,
but it is still present in the image store.

I thought of forcing value of draw:fill-image-name to some other value. For
that, I set the background image to some of the gallery. This effectively
changed the value of the attribute, I deleted the image and reverted to None
afterwards. Now, there are 2 images in the store: my custom one and the one
chosen from the gallery, both unreachable.

If you can make profit of this information … (I'm no developper :-( )

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190124/0bae9b0d/attachment.html>


More information about the Libreoffice-bugs mailing list