Last active
December 12, 2015 06:09
-
-
Save mattmccray/4727331 to your computer and use it in GitHub Desktop.
Shell script to optimize MangaStudio 5 files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The MangaStudio 5 (ms5) file format is actually just sqlite3 database. | |
| # | |
| # When you save and re-save them, they tend to accumulate a bit of cruft. | |
| # This script will loop through the specified .lip files and run the 'vacuum;' | |
| # command on each one, removing the cruft! | |
| # | |
| # WARNING: Use at your own risk! I've not had any problems, but it has not | |
| # been tested exhaustively. | |
| # | |
| # Installation: | |
| # | |
| # Add the following function to your .bash_profile, or save it as a separate | |
| # file and 'source' it. | |
| # | |
| # Usage: | |
| # $ optimize_lip *.lip | |
| # | |
| function optimize_lip { | |
| echo "Optimizing MangaStudio 5 files..." | |
| for var in "$@" | |
| do | |
| echo " ${var}:" | |
| size=$(du -k "${var}" | sed 's/\([0-9]*\)\(.*\)/\1/') | |
| echo " before: ${size} kB" | |
| sqlite3 "$var" "vacuum;" | |
| size=$(du -k "${var}" | sed 's/\([0-9]*\)\(.*\)/\1/') | |
| echo " after: ${size} kB" | |
| done | |
| echo "Done." | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Glad to hear it. 2gb is quite a savings! :)