"Garbage" collection in campaign files

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
Rupert
Kobold
Posts: 5
Joined: Mon Jan 08, 2018 3:11 pm

"Garbage" collection in campaign files

Post by Rupert »

I took a look inside one of my campaign files and noticed several images still in there when I know the objects/drawn element/etc that use them are gone. Is there any way to make maptool remove any assets that aren't being used?

I mean, it's not a big deal. My campaign file is only 40 mb, but the two images in question were both over 2 mb. Just those two alone would reduce the file by 10%, and I imagine there's a lot of smaller resources that I just haven't noticed yet.

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: "Garbage" collection in campaign files

Post by Merudo »

Check if some of the images are in tables, I know that fooled me a few times.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: "Garbage" collection in campaign files

Post by Phergus »

Rupert - Were they map images or something else like perhaps handouts on a token?

And welcome to the forums!

Rupert
Kobold
Posts: 5
Joined: Mon Jan 08, 2018 3:11 pm

Re: "Garbage" collection in campaign files

Post by Rupert »

Phergus wrote:
Sat Sep 07, 2019 9:05 am
Rupert - Were they map images or something else like perhaps handouts on a token?

And welcome to the forums!
It was a colours-on-white image I used to pattern fill a drawn prismatic wall. But the wall has since been dispelled & deleted from the campaign file.

Rupert
Kobold
Posts: 5
Joined: Mon Jan 08, 2018 3:11 pm

Re: "Garbage" collection in campaign files

Post by Rupert »

Merudo wrote:
Sat Sep 07, 2019 5:46 am
Check if some of the images are in tables, I know that fooled me a few times.
I'm a complete MT noob, I only use it as a pencil & paper mapping replacement, all my players are even in the same room w/ me. I don't use any tables (checked the tables window just now to be sure)

The image in my example is listed as the backgroundPaint of a drawn element, like I remember using it, but there's no such element in the the campaign anymore.

Code: Select all

           <net.rptools.maptool.model.drawing.DrawnElement>
              <drawable class="net.rptools.maptool.model.drawing.LineSegment">
                <id>
                  <baGUID>AAAAAJrS5l5isQMAAAAAAA==</baGUID>
                </id>
                <layer>BACKGROUND</layer>
                <points>
                  <java.awt.Point>
                    <x>3306</x>
                    <y>892</y>
                  </java.awt.Point>
                  <java.awt.Point>
                    <x>3306</x>
                    <y>892</y>
                  </java.awt.Point>
                </points>
                <width>1.0</width>
                <squareCap>false</squareCap>
              </drawable>
              <pen>
                <foregroundMode>1</foregroundMode>
                <backgroundMode>0</backgroundMode>
                <backgroundPaint class="net.rptools.maptool.model.drawing.DrawableTexturePaint">
                  <assetId>
                    <id>edbb0b732e4a72f53fc9d48f6664cc10</id>
                  </assetId>
                  <scale>1.0</scale>
                </backgroundPaint>
                <thickness>1.0</thickness>
                <eraser>false</eraser>
                <squareCap>false</squareCap>
                <opacity>1.0</opacity>
                <color>0</color>
                <backgroundColor>0</backgroundColor>
              </pen>
            </net.rptools.maptool.model.drawing.DrawnElement>

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: "Garbage" collection in campaign files

Post by Phergus »

Did you remove the drawing by deleting it from the Draw Explorer window or did you "delete" it by drawing over it with the erase option?

Check your Draw Explorer window and make sure it isn't there.

Rupert
Kobold
Posts: 5
Joined: Mon Jan 08, 2018 3:11 pm

Re: "Garbage" collection in campaign files

Post by Rupert »

Phergus wrote:
Sun Sep 08, 2019 7:09 pm
Check your Draw Explorer window and make sure it isn't there.
Deleted from draw explorer, and I searched all the drawn elements of all maps of the campaign file before I posted my question. Besides, this is just one example. There's at one, possibly two, other image assets that are hanging around orphaned.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: "Garbage" collection in campaign files

Post by Phergus »

That's curious. Tried a number of ways to make it happen and couldn't. What version of MapTool are you using?

Rupert
Kobold
Posts: 5
Joined: Mon Jan 08, 2018 3:11 pm

Re: "Garbage" collection in campaign files

Post by Rupert »

I'm using 1.5.1 right now. The campaign file has been this approximately this size for a while now, I was using 1.4.1.8 until 1.5.1 became available.

Yeah, I just don't get it.
The image, which has an asset id edbb0b[yada yada yada].png is then named in the corresponding edbb0b[yadayada] "<name>prismatic wall</name>". But then, outside of actual text (token notes) there's no occurrence of 'prismatic wall' in all of content.xml.

So, I've just manually deleted each pair of .png and naming-file from the campaign file asset folder and it still loads without any complaints. Weird. There's ~400 images/icons/patterns, so I only had a quick look at the bigger ones, there doesn't seem to be any other orphans. My campaign file went from ~40mb to just under 35mb.

edit: for what it's worth, the other two [large] image files that I deleted would have also been background drawn pattern files. Perhaps I found a combo for draw-undo-redo that made maptools lose track.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: "Garbage" collection in campaign files

Post by Phergus »

Rupert wrote:
Tue Sep 10, 2019 2:50 pm
... for what it's worth, the other two [large] image files that I deleted would have also been background drawn pattern files. Perhaps I found a combo for draw-undo-redo that made maptools lose track.
That could be. IIRC, undo was still pretty borked in MapTool 1.4.1.8.

Post Reply

Return to “MapTool”