Quite often i find myself wanting to resize a whole directory of images. Rather than opening them all in the gimp, i do it through the command line. I seem to do this often enough that it's worth recording here, for my own reference as well as for anybody else who would find it useful.
First of all, you need imagemagick.
sudo apt-get install imagemagick
Change directory to where the images are and create a subdirectory for the resized versions.
cd ~/Photos/2010/04/05
mkdir resized
My phone likes to put spaces in file names which really confuses things, so i convert them to underscores. You can skip this step if your filenames contain no spaces.
for image in *.jpg; do mv "$image" `echo $image | tr ' ' '_'`; done
Now for the clever bit: i run convert command on the image files, resizing them to 1024px and saving with a quality of 80%.
for image in *.jpg; do convert $image -resize 1024 -quality 80 resized/$image; done
Lovely wonderful linux! :D
One thing to note: it always resizes along the top edge, which may not be the longest edge. If you have a portrait file which is 1536×2048 it comes out at 1024×1365 (not 768×1024 as you might have expected).
The resize option can take a percentage, so if you know all your images are the same size then you could just send a 50% to reduce to half size.
for image in *.jpg; do convert $image -resize 50% -quality 80 resized/$image; done
Imagemagick is super-incredible-awesome so there probably is a way to deal with differently sized images at different orientations. If anybody knows, please add it in the comments! :)
Posted: April 5th, 2010
Categories:
computer,
geeky,
linux,
photos
Comments:
View Comments.
This beautiful photo was taken by @ecomba at Barton Farm this morning:

Quite appropriate, since the team have a big project to deliver today, which has been months in the making. I have worked on the project but i've been busy doing other things more recently.
Today i was safely out of the way pair programming with @edentodd at the Coffee House in Winchester:


We projected the code on the projector downstairs, it worked really well!
Coffee shop coding, ftw! :D
Posted: November 3rd, 2009
Categories:
barton farm,
photos,
work
Comments:
View Comments.
For once, a meme that's actually worth doing! My thanks go to Kapitano for this one. It takes a little while to do, but it's fun!
- Go to a random page on Wikipedia. The heading is your band name.
- Select the last in a list of random quotations, or the last few words of it. That's your album title.
- Take the third of a random selection of Flickr images. That's your album art.
- Now get creative.

My random Wikipedia page is Trip distribution, part of a mathematical transportation forecasting model.
My random quote:
The deepest definition of youth is life as yet untouched by tragedy.
- Alfred North Whitehead
English mathematician & philosopher (1861 – 1947)
For my Flickr image i couldn't take the third one because it was 'All rights reserved' so i kept going until i found one with a Creative Commons share and derive image. Which turned out to be this lovely picture: Hello flickr, (explored) by OUCHcharley.
Posted: February 26th, 2009
Categories:
art,
interesting,
meme,
photos
Comments:
View Comments.
Thought this was funny!

I love technology! I took the photo with my phone, bluetoothed it to the iMac, capped it on icanhascheezburger, uploaded it to Flickr, and inserted it into a blog post in a couple of minutes! :)
Posted: February 25th, 2009
Categories:
amusing,
photos
Comments:
View Comments.
It worked!!

Generated purely from people around the country sending tweets with their location and marks out of 10 for snow!
I gave a 9/10 for Winchester! It is beautiful soft powdery snow, slightly crunchy under-foot. Wonderful! It's still coming down thick and fast now, and apparently will do all day!


I love how milk deliveries in the UK are always so reliable! They will do their utmost to deliver milk if they possibly can.

Posted: February 2nd, 2009
Categories:
photos,
snow,
twitter,
web 2.x
Comments:
View Comments.
So my epic holiday is nearly over … i go back to work tomorrow after more than 3 weeks away. I actually can't wait to get back! I so enjoy the work that i do, and i appreciate the structure of knowing what is going to happen each day.
Here is my holiday summary:
- A few days at home relaxing and getting ready
- Four days in Germany
- A week in De Panne, on the North coast of Belgium over Christmas
- Back home and time with family and friends
- Dealing with horrible damp mouldy walls that got really bad when we were away
For more details and photographs, read on … but beware of the mould pictures if they might squick you out!
(more…)
Posted: January 4th, 2009
Categories:
astronomy,
bisexual,
family,
friends,
holiday,
home,
photos
Comments:
View Comments.
Tonight i saw a wonderful example of "the old Moon in the arms of the new", better known as earthshine.
When the Moon is new (and right now it is very new – just a thin sliver of sunlight is peeping around the side) then someone standing on the Moon would see a full Earth. Think how bright a full Moon can be for us on a clear night – the reflection of the Sun provides us a lot of light on such nights. Imagine how much more brightly it works the other way around – so brightly in fact that we can see the Moon shining with the reflection from the Earth.

If you do not see the silhouette of the trees, turn your screen brightness up. Then you should also see the earthshine on the unlit part of the Moon.
Our camera is not made for night time, but it does have a 3-second exposure. Unfortunately the tiniest shake shows up greatly exaggerated. I managed to capture this shot with the camera stuck against the window frame using blu-tack, and using the two-second timer feature. Otherwise the act of me pressing the button causes too much of a shake!
Oh by the way, i forgot to say, there's Jupiter shining as brightly as anything, too! The combination in the early night sky made for a beautiful sight, of which my photograph only conveys the tiniest fraction. If you have a clear night tonight or tomorrow, do have a look. It's incredible.
Posted: December 30th, 2008
Categories:
astronomy,
photos
Comments:
View Comments.
Wow, what a relief! I finished writing my Christmas cards at 18:30 this evening. I am so glad of the idea to print labels. Thanks to Rails, CouchDB and my pdf_label_maker library, it was much easier than usual. I just sat down and forced myself to get through them all, pausing only once to take a photo:

Note the chocolate, ruler and calculator, heheh! I actually bought some cheapo labels from the £1 shop … they weren't even on an A4 sheet, which meant i had to do quite a lot of measuring and trial and error. But i'm so pleased with the result – they look so neat, as opposed to my handwriting which gets terrible whenever i have to write a lot in one go.

Yes, i actually did write a Christmas card to topfunky! ;)
The best thing is … if i keep the database updated during the year, i can print them all out again next year! I'm definitely going to keep developing it, and learning more about CouchDB on Rails in the process.
Posted: December 14th, 2008
Categories:
couchdb,
geeky,
photos,
ruby on rails
Comments:
View Comments.
I managed to drag myself away from my computers this afternoon and have a lovely time outside.
First i went to visit this space of land that the WinACC local food group are hoping to renovate and turn into a city farm. I got these two lovely ducks on camera … they thought i had food for them. No such luck, heh!

I'll go back again soon and take some more photos of the area of land. If we go ahead with the transformation, it'll be really good to keep a photo blog! But today i didn't stay long because i was off to visit some friends and see the Christmas market. It was the first weekend, so it was predictably extremely busy, but again such a lovely atmosphere. The bells of the cathedral were ringing, there was carol singing, the crafts on offer were so beautiful and creative. We had mince pies and mulled wine! :)
This is without a doubt my favourite picture of the day:

Is that not just beautiful? Here are some other pictures of gorgeous lovely Winchester today …

There's more on Flickr.
Posted: November 29th, 2008
Categories:
friends,
greening,
photos,
winchester
Comments:
View Comments.
Well the worst of my illness is definitely over: i have managed to stay awake all day and i have just made some delicious ginger cookies!

I haven't made cookies for ages! They're so fun and easy to make, and trust me: they taste wonderful!
I've decided not to go out to the fireworks tonight because the weather is not too happy. Besides, i can probably see them just from looking out of the window!
Have you all heard that lovely new song from The Killers?
Are we human, or are we dancer?
My sign is vital, my hands are cold
And I'm on my knees looking for the answer
Are we human, or are we dancer?
I really have no idea what the song is supposed to be about, but i love the tune and it makes me want to dance! I take it to mean that we have a choice how we go through our lives: worrying and stressing about everything or just choosing to let it all go … and dance instead! What do you think of the song, and what do you think it is about?
Posted: November 8th, 2008
Categories:
music,
photos
Comments:
View Comments.