Maritime-Robotics-Student-Society / blog

Southampton sailing robot blog site
https://blog.sotonsailrobot.org/
MIT License
1 stars 1 forks source link

Generate thumbnails for images used on homepage #6

Open takluyver opened 6 years ago

takluyver commented 6 years ago

To save bandwidth and make the site load faster, we want smaller versions of photos for use on the homepage. @tsaoyu wrote a script to do this once for all posts:

https://github.com/Maritime-Robotics-Student-Society/blog/blob/gh-pages/utilities/optimize_thumbnail.py

It should be easy to do this for a new post when we've written it. It could even be configured as a git commit hook.

zysim commented 6 years ago

Created this branch to solve this. This is the commit in particular, but mind it isn't the latest commit in the branch. If the pull request #13 gets resolved, I can create another pull request for this branch too.

zysim commented 6 years ago

Take note too this script doesn't have any error handling for now. So if optimize_thumbnail.py fails, git will still move on to displaying the commit message window.

takluyver commented 6 years ago

Does the error show up in the terminal if it fails?

zysim commented 2 years ago

Sorry I had to get some dinner :P

Went through my script and well; it actually does. Although if the hook itself, as well as optimise_thumbnail.py (renaming that btw) errors, the hook will still allow you to proceed.

I'll make a new PR that'll have error handling.