remove unused background pictures used in format page style area

Hi

I have run into a problem others also have reported which is the LibreOffice writer keeps unused pictures in the internal folder pictures even if they are not used. In my examples it is pictures used in format page area (background) which stays even though they are not used.

Say you use picture A as your area background bit map, but you change it to Picture B, then to Picture C until you settle for Picture D as your background. The .odt keeps growing and all pictures A, B, C and D are still in the document pictures folder (visible when the .odt is made into a zip file) but the document is only using Picture D.

This question is vertically the same as this one posted in 2018.

and updated in 2020. The answer “I opened the document as ZIP file; opened “styles.xml”; looked through the list of draw:fill-image elements; searched for occurrences of each of them (draw:name) in the same file; noted those that either didn’t appear anywhere, or appeared in bitmaps where fill was “none”; removed the elements noted; removed related files from Pictures subfolder in the ZIP. by contributor Mike Kaganski” is great and it works. But is very cumbersome indeed. I don’t even seem to be able to edit the styles.xml inside the zip so I have to extract the styles.xml, do the changes, delete the styles.xml in the zip, add the edited styles.xml and then rename to .odt.

Is there an easier way to do all this inside LibreOffice writer (6.0 versions) itself?

PS. The bitmap navigator inside format - page - area does not show the imported bitmaps for some reason when you close and reopen the .odt so you cant delete anything from there.

@LibreMint,

Add double Enter (leave a blanck line) to separate paragraphs in you question.

@LibreMint wrote: Is there an easier way to do all this inside LibreOffice writer (6.0 versions) itself?

See discussion here:

It seems to be impossible for working in LO “itself”. New version 7.0.0.0Dev is still not improved and contains this bug as well as LO versions 6.x. -Cheers

Thank you for the answer. I (and others) will just have to use the zip method. Kind regards Mint