adicu / adicu.github.com-dep

The old adicu.com developed with jekyll and GitHub Pages
http://old.adicu.com/
6 stars 12 forks source link

Resize images in blog posts #240

Closed parthibanloganathan closed 10 years ago

parthibanloganathan commented 10 years ago

They were way too big, it wouldn't load the page. Thoughts on adding a simple script to newpost.sh to resize all images mentioned in the post:

#!/bin/bash
for i in *.JPG; do convert $i -resize "1000x900" $(basename $i .JPG).jpg;
schlosser commented 10 years ago

this is waaay too specific. What if it's jpeg or jpg or png or gif? Also, there are some images we don't want resized, will this only work for files mentioned in the post or all files? All the files are not in the root img directory, will those be resized? At the point of running newpost.sh we haven't written the post yet so it would be impossible to do this then without resizing every image. Also, we don't know the aspect ration of the images.

parthibanloganathan commented 10 years ago

The code snippet was just a rough idea. We can elaborate to make it jpg, gif, etc. The aspect ratio part is maintained by resize. It shrinks till the larger of width or height fits the specified values. We could batch process all images in a separate blog pictures folder. But I see what you mean with pictures that we don't want resized.

Any way, this pull request doesn't add the script. It just fixes Angela's blog post which was using extremely hi-res images.