# Purging unused graphics files from mod?

**URL:** <https://forum.vassalengine.org/t/purging-unused-graphics-files-from-mod/543>\
**Category:** Module Design\
**Created:** [April 25, 2008, 2:04am UTC](https://forum.vassalengine.org/t/purging-unused-graphics-files-from-mod/543 "2008-04-25T02:04:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bullman](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/b/a3d4f5/32.png) [@Bullman](https://forum.vassalengine.org/u/Bullman)\
**Post date:** [April 25, 2008, 2:04am UTC](https://forum.vassalengine.org/t/purging-unused-graphics-files-from-mod/543/1 "2008-04-25T02:04:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [April 25, 2008, 9:14am UTC](https://forum.vassalengine.org/t/purging-unused-graphics-files-from-mod/543/2 "2008-04-25T09:14:01Z")

</div>

Thus spake “Bullman”:

> [@](#):
>
> Hello
> 
> Just wondering of there is a simple way to purge any unused/unreferenced grap  
> hics files that found their way into a mod.
> 
> eg. You may have used a graphics file for a counter but tehn replayed it wit  
> h another graphics file with another name. A copy of the original graphics f  
> ile remains in the mod file.
> 
> Cheers
> 
> Bull

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

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Bullman](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/b/a3d4f5/32.png) [@Bullman](https://forum.vassalengine.org/u/Bullman)\
**Post date:** [April 25, 2008, 11:35am UTC](https://forum.vassalengine.org/t/purging-unused-graphics-files-from-mod/543/3 "2008-04-25T11:35:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [April 25, 2008, 2:45pm UTC](https://forum.vassalengine.org/t/purging-unused-graphics-files-from-mod/543/4 "2008-04-25T14:45:00Z")

</div>

Thus spake “Bullman”:

> [@](#):
>
> 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 refer  
> enced (or not referenced) by a VASSAL mod?
> 
> Apart from looking through every prototype/counter definition individually, i  
> s there another recommended way/procedure of identifying unused grapahics fil  
> es from a mod?
> 
> 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](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Jayraider](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/j/a9a28c/32.png) [@Jayraider](https://forum.vassalengine.org/u/Jayraider)\
**Post date:** [April 25, 2008, 7:48pm UTC](https://forum.vassalengine.org/t/purging-unused-graphics-files-from-mod/543/5 "2008-04-25T19:48:41Z")

</div>

> [@Bullman](#):
>
> 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

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. 🙂

---

<div class="post-metadata">

**Author:** ![Bullman](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/b/a3d4f5/32.png) [@Bullman](https://forum.vassalengine.org/u/Bullman)\
**Post date:** [April 26, 2008, 4:05am UTC](https://forum.vassalengine.org/t/purging-unused-graphics-files-from-mod/543/6 "2008-04-26T04:05:45Z")

</div>

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