M0nica / httriri

HTTRiRi - HTTP Status Codes as Portrayed by Rihanna GIFs ✨💄
https://www.httriri.com/
GNU General Public License v3.0
55 stars 22 forks source link

Added workflow to automatically resize large gifs #74

Closed SijmenHuizenga closed 4 years ago

SijmenHuizenga commented 4 years ago

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 commented 4 years ago

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

M0nica commented 4 years ago

Ah, actually it seems the current set up is having issues with fork and being able to push. https://github.com/actions/checkout/issues/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 commented 4 years ago

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 commented 4 years ago

I'm noting my investigation findings in #77