Remove unused Images Tool

OS: Windows 10
Memory: 16GB
VASSAL: 3.5.5 and 3.5.6.
Module: New module under construction.

I started with the module Deadly Northern Lights that I developed for Thin Red Line games. In the module I deleted the references to all of the counter images, the maps, and some chart images. I then used the Remove unused images tool to remove the images from the module. I saved the module under a new name.

I then built out the module into a new game based on the original. New Maps, charts and counters. Before I started creating the counters I used the remove unused image tool once or twice more. No issues.

After using the create multiple pieces tool repeated to had about 600+ counters I wanted to check and see if I’d accidently orphaned any images. I ran the remove unused images tool and the list it creates of unused images is basically every single counter image that I have added since I started using the add multiple pieces option. See image.

Module works fine with no issues. Just concerned because now I can’t really use the remove unused pieces when I finally completely finished with the module.

Hi,

Could you do the following test please.

1.Take a backup of your module
2. Start a new Vassal session, load the module, run the removed unused images tool and remove all the unused images.
3. save and reload the module and see if it works as expected.

If it does work, then those images where no actually in use.
If it does not work, then can you please send us a link to the backup copy of the module so that we can investigate.

Thanks.

HI,

I reported something similar in Bug 14479

I have the same problem and it includes game piece image prototypes and any game pieces that I made with them. I recently changed 32 50px buttons to 40px buttons and 2 of these new 40px icons are now showing up as unused along with some others that were already there. This happens with v3.5.5 and v3.5.6. The image prototypes show up in the unused list without any file extension.

I tried the test you suggested above. On restart I received “missing” error messages for the removed png images but not for any of the piece image prototypes. The module did not correctly display any item using the pngs that were removed but did display the image prototype-base pieces correctly.

I re-tried the test but did not remove the images that gave errors. On restart there were no error messages and everything displayed as normal but the game piece prototypes images removed were still listed as needing removal. Their files are not in the vmod /images directory anymore and but are in a /removed sub-directory in the vmod location. If this is repeated the images are still there but an “already removed” entry is in the log file. If the remove dir is deleted each time this can be repeated without complaint many times as I like.

Attached is a small module that illustrates the piece prototype image problem. The module with the in-use pngs listed as unused is much larger but will be distributed on the Modules page quite soon. Is there a better way to get 44MB file to you?

danh

Ah, that is the key not mentioned by the first poster. Yes, there may well be a problem with Game Piece Images. Short-term solution, don’t use the remove unwanted images. We’ll look into the problem.

Thanks.

I’ve pushed a PR (971) to fix 14479, against the 3.5.8 branch.

Thanks go out to both of you.

blue

Hi,

Got a chance to try v3.5.8 today. Most of the false positives no longer show as unused but some remain.

  1. Symbolic Dice Button - I have two of them each with an image and both images are listed as unused.
  2. Zone Highlighter tiles - all three images I use for Zone Highlighters are listed as unused.
  3. Game Piece Image Definitions - all images placed on a counter that is then drawn on are listed except one that is jpg not png.

I changed that one jpg to png but it still does not show as unused. It i,s however, used in several other objects like a report button and a marker.

blue

Is this problem still occurring with 3.6.0-beta1? If so, could we have the module which demonstrates the probelm?

The problem is (at least partly) still there with 3.6.4.

You can find a small module “RemoveUnusedImages_0.1” under Vassal Stuff

The “Remove Unused Images” command will find the “CounterBorder.png” as unreferenced, even though it is used under Game Piece Image Definitions.

Using Vassal Version 3.6.4 on Windows 10, Version 20H2, 64bit.

Try the VASSAL-3.6.5-SNAPSHOT-548d4bd-UnusedImageItem build. Does that solve the problem for you?

Hmm, the link goes to /builds/build , so there is a 404.

I removed the second “build” and downloaded the version you provided. Testing right now.

Works like a charm on my end. Nothing is selected, neither in the test build I provided nor in the larger project I’m working on.

Thanks again!

1 Like