Get in touch:
01524 851 877
07718 896 553

Image File Conversion Script

Posted on Jan 12 2011

Here’s a nice simple script to convert all the pdf files in a directory to jpg files using the convert program. To use this you will need ImageMagick installed on your Linux/Unix host.

#!/bin/bash

for file in `ls *.pdf`
do
   convert $file `echo $file | sed 's/\.pdf$/\.jpg/'`
done

Resizing An Image With PHP

Posted on Apr 08 2010

I came across this PHP class today that is great for resizing images. It is extremely easy to use and quite a small class. The class file can be downloaded here:

SimpleImage.php

A quick example usage to show how simple it is…

include('SimpleImage.php');
$image = new SimpleImage();
$image->load('picture.jpg');
$image->resize(250,400);
$image->save('picture2.jpg');

The last time I had to do some image resizing with PHP was a number of years ago and I seem to remember it being a lot more complicated than this.

Thanks to White Hat Web Design for making this little class and making it available.