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

Doc: Compress PNG images. #10086

Closed
wants to merge 1 commit into from
Closed

Doc: Compress PNG images. #10086

wants to merge 1 commit into from

Conversation

Fdawgs
Copy link
Contributor

@Fdawgs Fdawgs commented Oct 17, 2022

Motivation / Problem

Repo size can always be smaller!

Description

Losslessly compress documentation PNG images using Pngcrush to reduce the repo size by a few bytes.

Limitations

N/A

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@LordAro
Copy link
Member

LordAro commented Oct 17, 2022

This needs to be done extremely carefully, as PNG compressors tend to fiddle around with image palettes, and OTTD/grfcodec/etc is very specific about the image palette of the image - changing that will cause issues

Also, there's a conflict - which raises the other issue - as soon as this images get edited, the compression will get undone, and so will only serve to bloat the repo size.

Compressing the images in docs is fine though

@Fdawgs
Copy link
Contributor Author

Fdawgs commented Oct 17, 2022

This needs to be done extremely carefully, as PNG compressors tend to fiddle around with image palettes, and OTTD/grfcodec/etc is very specific about the image palette of the image - changing that will cause issues

Thanks @LordAro, will update the PR to only update the doc images in that case.

@Fdawgs Fdawgs changed the title Change: Compress PNG images. Doc: Compress PNG images. Oct 17, 2022
@FLHerne
Copy link
Contributor

FLHerne commented Oct 17, 2022

Does this decrease the repo size? The old versions of the files are still in the history.

git clone by default copies the entire repository including all previous commits, so now most people are downloading both the old and new versions of the files (or one and a binary diff) resulting in an increase. Similarly, everyone with an existing clone will have to download the new versions when they git pull.

The only benefit is to users making a shallow clone with git clone --depth=n which is relatively unusual.

@Fdawgs
Copy link
Contributor Author

Fdawgs commented Oct 17, 2022

Good point @FLHerne, will drop this PR. Thanks!

@Fdawgs Fdawgs closed this Oct 17, 2022
@Fdawgs Fdawgs deleted the chore/images branch October 17, 2022 10:20
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.

None yet

3 participants