My first public Github script is posted for optimizing images on this blog :)

I had the issue of this blog, that it was created over many many years, with years of inactivity also, that many off the pictures were pretty large and not optimized for any web usage. Huge pictures of +15 megabyte takes a loong time to load on slower connections. There are at the current count 6750 pictures in a many different folders under the /upload folder in WordPress. So getting to them one by one would take for ever. But at the moment im taking an online Python course, which i very much recommend by the way ! 100 days of code

You can find it here.

So after some time on the course, it came to me that with the knowledge i have learned so far, and some searching on StackOverflow and Google i could couple something together myself with the help of the Python Pillow Library which has a lot of functions for manipulating images 🙂

So the pictures are now optimized, and you can find the script here https://github.com/anderskeis/PyCompress on my Github profile. Take a copy down of your /upload folder it Github and try on your own risk 🙂 Do a backup before, IT WILL OVERWRITE YOUR PICTURES! it should ignore anything it cannot optimize. And then re upload to your blog again. Works with any pictures folder, but only tested it on Linux, so good luck 🙂

This entry was posted in Computere, Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *