Deleting unused images from odp file

Discuss the presentation application
Post Reply
firatkucuk
Posts: 3
Joined: Tue Jan 22, 2008 11:45 am

Deleting unused images from odp file

Post by firatkucuk »

hi,
i renamed oo impress .odp file to .zip file and extract to a directory.
Then i noticed lots of unused pictures (that i deleted from presentation before) in the directory.
Some of these pictures has no active reference.

How can i delete this files via using impress?
TerryE
Volunteer
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: deleting unused images from odp file

Post by TerryE »

Hint on opening ODF files under XP you can right click and use Open With to select WinZIP (or whatever your installed zip utility is) to open them directly without having to rename the file.

Find one of the "deleted" images and note its name. Then open the content.xml file and search for this name. If you get a hit then it is still referenced. Looking at the adjacent XML should give you a clue.

I thought that it might be to do with the UNDO stack, but Impress does not preserve this over a save.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
firatkucuk
Posts: 3
Joined: Tue Jan 22, 2008 11:45 am

Re: deleting unused images from odp file

Post by firatkucuk »

i didn't find the file name in the content.xml. Shouldn't impress delete the file if it has no reference?
firatkucuk
Posts: 3
Joined: Tue Jan 22, 2008 11:45 am

Re: deleting unused images from odp file

Post by firatkucuk »

i found it in the styles.xml

<draw:fill-image draw:name="sablon" xlink:href="Pictures/1000000000000640000004B01F663B31.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>

there is no reference in content.xml.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: deleting unused images from odp file

Post by acknak »

So it looks like the image is used in a style definition, possibly as a background image. That style may not be in use, but it could be used, so the image is kept in the presentation file. To completely "release" the image, you need to find that style and change it to use a different background.

I think I have seen a way to delete all unused styles but I can't remember where.
AOO4/LO5 • Linux • Fedora 23
TerryE
Volunteer
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: deleting unused images from odp file

Post by TerryE »

You will see the expand symbol to reveal style at the middle right hand edge of the Impress viewing pane to the right of the scrollbar. Clicking on this will expose the Styles toolbar. You can use the filter to select various views, such as only applied styles. You right click to delete any custom style, but its first a good idea to see if its applied, because deleting applied styles could mess up your layout.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
micha137
Posts: 33
Joined: Mon Dec 03, 2007 12:25 pm
Location: Wedel/Germany

Re: deleting unused images from odp file

Post by micha137 »

Hi,
I have a similar annoyance with an unused background pattern. Searching the styles part gave me some 2-3 references, but the pattern is definitely not used. Additionally there is no style among the applied styles which uses it. I suspect the background pattern came with a graphics object(not using the pattern) which I created in draw and inserted by copy and paste.
In Impress however, the pattern of size 14kB seems to lead its own gypsy life without beeing anchored to a definite slide. Sometimes, deleting the slide with the graphics that probably imported this "illegal alien" removed the ghost pattern, sometimes it was only removed after deleting some more(almost all) slides. But reintroducing another slide, that had nothing to do with the graphics, did reintroduce the ghost pattern again. So I can't pinpoint it to a specific object or even slide.
Up to now I decided I have to live with this, since It is really a minor issue, but I can't help being uncomfortable about this and consider this as a potential security hazard.
Perhaps the ghost was introduced erroneously while using an old dev-snapshot and is not cought by the current cleanup routines? All my files containing the "ghost" were created in a certain time span (some moths agon still in my old windows days).

regards micha137
happy user of ubuntu "gutsy"
OOo 3.0.X on Ubuntu 8.x
User avatar
ccornell
Volunteer
Posts: 611
Joined: Sun Oct 07, 2007 7:21 am

Re: deleting unused images from odp file

Post by ccornell »

Use this extension:
http://extensions.services.openoffice.o ... nMinimizer
The extension should strip out unused images as well as speaker notes etc (if you tell it to of course). Works pretty good for me :)
openSUSE 11.4, KDE4.6 with OpenOffice.org 3.3
micha137
Posts: 33
Joined: Mon Dec 03, 2007 12:25 pm
Location: Wedel/Germany

Re: deleting unused images from odp file

Post by micha137 »

Hi,

the post made me check again in more detail.
In my case the ghost image indeed comes with pasted draw objects from an old (faulty) oo-draw version. The ghost is gone when I copy the grouped drawing to the a current oo-draw page, delete the group in impress and plainly reinsert it again per copy and paste from the current draw page. I have to do it with all draw objects to get rid of the ghost.
The fact that I couldn't pinpoint the location of the ghost before was due to the fact, that I had multiple draw objects inserted (some of them small so I wasn't aware of them) and each of them independently caused reappearance of the ghost-pattern.

I did not succeed in my attempts to do something to the styles directly. Indeed in my case the hatching "red_crossed_45_deg" (even though never used) referred to the bitmap "Orange"(the "ghost-image" even though there is a valid "Orange" in the standard settings) without using it and without any apparent possibility to remove the nonsense "Orange" filling via editing the hatching-style.

So it was due to a past faulty oo-draw version or installation in my case and seems to be no problem anymore with recent OO-Impress/Draw files.
Maybe you could check, whether any imported objects from older OO-components carry the ghost-image(s) in your case too.

regards
micha137
OOo 3.0.X on Ubuntu 8.x
TerryE
Volunteer
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: deleting unused images from odp file

Post by TerryE »

At least you can diagnose why you've got the baggage in the ODP file. I work with PPTs at work and Powerpoint (up to 2003) will often not bother to reclaim dead space in a file so in an extreme case where someone has taken a 20 slide deck and deleted all bar one slide the PPT is still the same size. I sometime use OOo Impress to open and save such PTTs to garbage collect this crap. I've reduced PPTs from 5Mbytes to 0.3Mbytes doing this. Bizarre and slightly off subject but there you go.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: deleting unused images from odp file

Post by acknak »

The bitmap area fills seem to be in a different category. You have to specially load it into the list of bitmaps, and that list is available in the other OOo apps. That's very different from a style background image.

Perhaps if you go to the area fill bitmap list and delete it there, it will release the data from the document.
AOO4/LO5 • Linux • Fedora 23
Post Reply