Purging unused graphics files from mod?

Hello

Just wondering if there is a simple way to purge any unused/unreferenced graphics files that found their way into a mod.

eg. You may have used a graphics file for a counter but then replaced it with another graphics file that has a different name. A copy of the original graphics file remains in the mod file unused and just bloating the size of the mod

Cheers

Bull

Thus spake “Bullman”:

No, but we intend to add such a feature for 3.2.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

OK. I kind of know what answer I will get but it is still worth asking…Is there a way to view a list of all the graphics files which are actually referenced (or not referenced) by a VASSAL mod?

Apart from looking through every prototype/counter definition individually, is there another recommended way/procedure of identifying unused grapahics files from a mod?

Bullman

Thus spake “Bullman”:

Yes. If you’re on a UNIX system, you can grep the buildFile contained
inside each module for image filenames. E.g., something like

grep -Pio ‘\w+.(jpg|gif|png|svg)’ buildFile | sort | uniq

will give you a list of all images referenced in a module’s biuldFile,
and then you can use comm to compare that list with the contents of
the images directory.

That’s the best way to do it at present, until we write the code for
purging unused images.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

If the mod is in .zip form, open it with Winrar and delete the un-necessary image files.
Has worked for me in the past. :slight_smile:

Yes thanks Jayraider, I know that I can do that but it is knowing which files to delete which is the problem.