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

Added workflow to automatically resize large gifs #74

Merged
merged 2 commits into from
Oct 6, 2020
Merged

Added workflow to automatically resize large gifs #74

merged 2 commits into from
Oct 6, 2020

Conversation

SijmenHuizenga
Copy link
Contributor

@SijmenHuizenga SijmenHuizenga commented Oct 5, 2020

This pr adds a workflow that automatically resizes any gifs wider than 300px to 300px. This reasoning behind this procedure can be read in #62. It uses imagick mogrify which replaces the old file with the resized file. I noticed that sometimes a file has a larger filesize than after resize. I think this has something to do with compression. I don't think this is a problem since Imgbot will compress any uncompressed images anyway.

Relates to #62

Pages/Interfaces that will change

Most images will be smaller. This should be an invisible change.

Steps to test

This example pr shows what happens when you add new images that are too large. It also shows that no commit is made if no files were changed.

Additional notes

Why not just do mogrify -resize '300>' public/images/*.gif instead of looping? Because somehow running this resize command twice on the same file will change the file twice. Manually checking for width is more stable.

@M0nica
Copy link
Owner

M0nica commented Oct 6, 2020

This looks good to me. Thank you for contributing these optimizations! I am going to proceed with merging.

@M0nica M0nica merged commit 3f9d5bf into M0nica:main Oct 6, 2020
@M0nica
Copy link
Owner

M0nica commented Oct 6, 2020

Ah, actually it seems the current set up is having issues with fork and being able to push. actions/checkout#124

I am getting fatal: You are not currently on a branch. example: https://github.com/M0nica/httriri/runs/1217449782?check_suite_focus=true

This will need to be addressed before the action is runnable. I tried to make some hot fixes to the workflow but it looks like it will require a bit more work.

@SijmenHuizenga
Copy link
Contributor Author

SijmenHuizenga commented Oct 6, 2020

hmmm that's weird, on my fork it worked. I will investigate

I'm going to try to reproduce this by re-forking this repo. Let's see how this goes :)

@SijmenHuizenga
Copy link
Contributor Author

I'm noting my investigation findings in #77

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.

2 participants