Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore compression of SVG files on export #139

Merged
merged 1 commit into from
Sep 5, 2016

Conversation

Self-Perfection
Copy link
Contributor

I'm working on shared deck, which is going to contain ~ 280 MB of SVG images. Since 3bbd0bc media files are stored in exported deck without compression and exported .apkg file takes whole 280 MB instead 80 MB that it takes with compression. Huge waste of space.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling a5b0852 on Self-Perfection:compress_exported_svg_files into * on dae:master*.

@dae
Copy link
Member

dae commented Sep 5, 2016

Looks good, thanks.

@dae dae merged commit 2b8d2c9 into ankitects:master Sep 5, 2016
@Self-Perfection
Copy link
Contributor Author

Probably compression of all exported media files should be restored.

A couple of days ago I stumbled upon shared deck, which contains 373MB of uncompressed jpg and mp3 files but 39% less space in compressed apkg form! Seems mostly due to mp3 files. That is quite surprising.

Assumption that media files can't be deflated considerably might not be true even for non svg files. There is a bunch of real word shared decks that might be used to gather stats and decide whether media should be deflated or not. I propose to run something like

find "$SHARED_DECKS_DIR" -size +1M ! -newermt '2016-02-26' -exec sh -c "unzip -v '{}' | tail -1" \; | sort -rnk3 | nl

and see real numbers to decide. This oneliner finds files over 1MB which were modified before date of commit, which disabled compression, and prints numbered list of stats for each file ordered by space saved percentage

@dae
Copy link
Member

dae commented Sep 9, 2016

If the mp3s are very small then they probably compress well because ID3/standard boilerplate makes up a decent amount of the total size.

The speedup from removing compression was something like 1000%, and in the backup/collection import/export case the space savings are not worth it. But I will think about whether it makes sense to make it available as an option in the future - thank you for the feedback.

@Self-Perfection Self-Perfection deleted the compress_exported_svg_files branch September 9, 2016 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants