Create account / Log in

Removing Unused Pictures

Topics related to Vassal game modules.

Moderators: Tim M, uckelman

Removing Unused Pictures

Postby pawnpusher » March 24th, 2020, 1:43 am

I've fallen into the trap of naming each version of a map or component with a new name, and I have several unused pictures in my module some of which are rather large.

How does one remove them?

Or should I consider starting over with the module from scratch?

Thanks.
User avatar
pawnpusher
 
Posts: 8
Joined: October 5th, 2013, 4:04 am
Location: Texas

Re: Removing Unused Pictures

Postby uckelman » March 24th, 2020, 11:02 am

Thus spake pawnpusher:
> I've fallen into the trap of naming each version of a map or component
> with a new name, and I have several unused pictures in my module some of
> which are rather large.
>
> How does one remove them?

Modules are ZIP archives. Unzip the module, remove the images you don't
want, rezip the module.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8382
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Removing Unused Pictures

Postby ChuckS » March 24th, 2020, 1:11 pm

Backup the module first in case you wreck it in the cleanup process, it's best to unzip to a file into a directory then go clean out the items you don't need. Then create a new compressed folder and copy the remaining data back into that compressed folder, then rename that folder back to the original game module name.

If you try and delete inside the zip file it will take forever! Just remember backup backup backup.
ChuckS
 
Posts: 99
Joined: August 16th, 2016, 4:37 pm

Re: Removing Unused Pictures

Postby JoelCFC25 » March 24th, 2020, 1:26 pm

ChuckS wrote:If you try and delete inside the zip file it will take forever!

This needn't be the case. If you use the compression tools built into Windows Explorer, this is true, because those tools are hideously broken. If you use a good 3rd party tool like 7zip, opening a ZIP archive and deleting files within it is a nearly instantaneous process as it should be--no complete unzip/rezip needed.
JoelCFC25
 
Posts: 690
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Removing Unused Pictures

Postby pawnpusher » March 25th, 2020, 3:22 am

Thanks all!
User avatar
pawnpusher
 
Posts: 8
Joined: October 5th, 2013, 4:04 am
Location: Texas

Re: Removing Unused Pictures

Postby shilinski » March 25th, 2020, 8:25 am

I second using a third-party zip tool. I use 7zip all the time because I don't have to unzip the files, and I can do mass image replacement (just make sure the files have the same name) without having to use the editor.

You have to be careful too when unzipping and rezipping because you can inadvertently pull in files (hidden files especially) that you don't want. I've occasionally looked at mods I haven't worked on, and sometime I've seen tons of obvious junk inside. Once I saw another entire copy of the vmod inside the vmod! I wonder if that vmod itself contained another vmod, and then that one too. Sort of a Russian dolls sort of thing. I never checked.
shilinski
 
Posts: 156
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: Removing Unused Pictures

Postby pawnpusher » March 29th, 2020, 3:41 pm

I downloaded and used the 7-zip app as suggested above. It worked great!

Thanks again!
User avatar
pawnpusher
 
Posts: 8
Joined: October 5th, 2013, 4:04 am
Location: Texas

Re: Removing Unused Pictures

Postby DaveJM » April 2nd, 2020, 3:06 pm

I have the same problem of unwonted pictures. I saved the game as .zip and unzipped it and removed the unwonted pictures.
I zipped it up.
Changed .zip to .vmod in Win10 explorer. I cannot open it, it comes up with error message "The file 'C:\Users\Charlie\Documents\Games\Vassal\Waterloo 20 VP\WaterlooV2R.vmod' cannot be imported into VASSAL."
Can anyone help me please. Thank you.
DaveJM
 
Posts: 5
Joined: October 29th, 2018, 2:52 pm

Re: Removing Unused Pictures

Postby uckelman » April 2nd, 2020, 7:46 pm

Thus spake DaveJM via messages:
> I have the same problem of unwonted pictures. I saved the game as .zip
> and unzipped it and removed the unwonted pictures.
> I zipped it up.
> Changed .zip to .vmod in Win10 explorer. I cannot open it, it comes up
> with error message "The file
> 'C:\Users\Charlie\Documents\Games\Vassal\Waterloo 20
> VP\WaterlooV2R.vmod' cannot be imported into VASSAL."
> Can anyone help me please. Thank you.

That sounds like you're trying to open the module using Import instead
of Open. Import is for converting modules from a different file format.
Open is what you should be using.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8382
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Removing Unused Pictures

Postby DaveJM » April 3rd, 2020, 12:33 pm

Thank you for your speedy reply. Unfortunately using open instead of import did not work.
I have tried using 7-Zip and PeaZip to zip up the files which have the suffix .zip, and the zip icon.
Used File Explorer to change from .zip to .vmod and the icon changed to the Vassal V.
Using Open, Import or double clicking on the icon produce the same result, does not open and the same error message.
I have tried using Import on the .zip with the same result.
Using Win 10 with Vassal 3.2.17.
Is there a step by step guide anywhere to remove unwonted graphics from Vassal modules as I think I must be making a silly error somewhere.
Thank you.
DaveJM
 
Posts: 5
Joined: October 29th, 2018, 2:52 pm

Re: Removing Unused Pictures

Postby JoelCFC25 » April 3rd, 2020, 1:17 pm

If you are using 7zip, you should immediately be able to spot the problem. Open the file that you believe to be your module using 7zip. If you don't see items named "buildfile" and a folder named "images", then your ZIP archive is not correctly constructed. I would guess you are zipping the wrong items, so the root level of your ZIP archive doesn't contain the needed items VASSAL expects--for example, it's a common error to right-click and zip up the parent folder that contains all the unzipped module's contents. Ideally you should be multi-selecting the buildfile, the images folder, and any predefined setup files, and zipping up that group of items.

One of the main benefits of using 7zip is that you should not have to be changing file suffixes at all.
JoelCFC25
 
Posts: 690
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: Removing Unused Pictures

Postby DaveJM » April 3rd, 2020, 8:32 pm

Thank you JoelCFC25.
Problem solved. Now to make a lot of my modules smaller.
DaveJM
 
Posts: 5
Joined: October 29th, 2018, 2:52 pm


Return to Module General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests