Removing unused artwork

MacOS 10.6.8, Vassal 3.2.13, new module

I am trying my hand at creating a new module. Everything fine until I decided to replace my PNG maps with JPG maps (to save 90% of file size). So I edited the map definitions to point to the new files. When starting the module, the tiling dialog shows that VASSAL has kept the old files, and when I look into the vmod the the PNG files I can confirm are still there. I unzipped the vmod, removed the files manually and re-zipped (using the MacOS compress utility and changing the extension to vmod), but VASSAL then does not recognize the module anymore (invalid module error message).
How to proceed? Is it a problem with compress? Or do I need to edit the buildfile manually to get rid of the unwanted artwork?
The How To PDFs and the Wiki did not answer my question. Sorry if I overlooked something obvious.

Lutz Pietschker

Thus spake PunTheHun:

MacOS 10.6.8, Vassal 3.2.13, new module

I am trying my hand at creating a new module. Everything fine until I
decided to replace my PNG maps with JPG maps (to save 90% of file size).

Why do that? It saves no memory at runtime and decreases image quality.

So I edited the map definitions to point to the new files. When starting
the module, the tiling dialog shows that VASSAL has kept the old files,
and when I look into the vmod the the PNG files I can confirm are still
there. I unzipped the vmod, removed the files manually and re-zipped
(using the MacOS compress utility and changing the extension to vmod),
but VASSAL then does not recognize the module anymore (invalid module
error message).
How to proceed? Is it a problem with compress? Or do I need to edit the
buildfile manually to get rid of the unwanted artwork?

Due to a design flaw (which we now can’t correct becasue doing so would
break every custom class in every module with custom classes), VASSAL
can’t detect which images are in use, so can’t remove from modules ones
which are not. This won’t be a problem with VASSAL 4, as that will be a
new codebase, but can’t be fixed in VASSAL 3.2.

To remove the unused images, unzip the module, delete the unused images
from the images directory, then rezip the module. Nonetheless, I urge
you to consider whether the beneftis you get from switching from PNG
to JPEG are real.


J.

Thanks for the fast reply!

As I wrote, this is exactly what I tried and what caused VASSAL not to recognize the module as valid anymore. The error message just says that it is an invalid VASSAL module. I tried yemuzip instead of MacOS compress, but the result is the same.

Wilco.

Thus spake PunTheHun:

“uckelman” wrote:

To remove the unused images, unzip the module, delete the unused
images
from the images directory, then rezip the module.

As I wrote, this is exactly what I tried and what caused VASSAL not to
recognize the module as valid anymore. The error message just says that
it is an invalid VASSAL module. I tried yemuzip instead of MacOS
compress, but the result is the same.

That means you’re getting the directory structure wrong when you rezip.
Use a program which will show you the contents of ZIP archives (e.g., on
Linux I would use zipinfo) to compare the old, working module with the
one you modified.

The most common mistake is introducing a directory between the old root
and the new root (i.e., instead of having the buildFile as a child of
the root of the archive, you now have a directory X as a child of the
root and the buildFile as a child of X).


J.

Yep, that’s it! Thanks again for the fast and effective help. The module looks good now. Now for the details…