Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Convert test images from svg to svgz #9214

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

Closed
wants to merge 2 commits into from
Closed

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 22, 2017

The conversion was done with

for f in lib/**/baseline_images/**/*.svg; do
    gzip --best <"$f" >"$f"z; rm "$f"
done
sed -Ei 's/(extensions=.*)svg/\1svgz/g' **/*.py

(svgz is literally gzip'ed svg)

and manual fixes to the tests (in a separate commit).

The global size of all test svgs was 15Mb; it is 4Mb after compression.

Obviously that won't help with objects stuck in the git repository; instead, the main advantage is to make future addition of more svgs less problematic (the largest objects in the git repo are some svgs >5Mb (that have been deleted but are stuck in the history forever)), and also to prevent Github from showing svgs in the PR diff interface (although the later can also be achieved using gitattributes).

Alternative (or complementary to) #9215.

EDIT: Actually git appears to zlib-compress its objects (https://matthew-brett.github.io/curious-git/reading_git_objects.html) so this PR may not be that helpful wrt repo size...

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

The conversion was done with

    for f in lib/**/baseline_images/**/*.svg; do
        gzip --best <"$f" >"$f"z; rm "$f"
    done
    sed -Ei 's/(extensions=.*)svg/\1svgz/g' **/*.py

(svgz is literally gzip'ed svg)

The global size of all test svgs was 15Mb; it is 4Mb after compression.
@tacaswell
Copy link
Member

I am skeptical...

@anntzer
Copy link
Contributor Author

anntzer commented Sep 22, 2017

Me too...

@anntzer
Copy link
Contributor Author

anntzer commented Sep 22, 2017

I think #9215 addresses most of the issue and it's not even clear the rest is a benefit.

@anntzer anntzer closed this Sep 22, 2017
@anntzer anntzer deleted the svgz branch September 22, 2017 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.