Written by
David Artiss. Published 3 years, 4 months ago. Last modified 3 years, 2 months ago. In categories
Web Development.
I mentioned in a post yesterday that I also use PHP to generate image thumbnails. The idea is that any new photos I simply upload to the BMTG site, with a Picasa caption attached, and the site should do the rest.
Thumbnails are generated on-the-fly but only once as, once created, they are saved and re-used.
if (!file_exists($thumb_filename)) {
$src_img=imagecreatefromjpeg($full_filename);
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
$new_w=round(($old_x/$old_y)*100);
$new_h=100;
$dst_img=ImageCreateTrueColor($new_w,$new_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$old_x,$old_y);
imagejpeg($dst_img,$thumb_filename);
imagedestroy($dst_img);
imagedestroy($src_img);
}$thumb_filename should contain the filename of the thumbnail and $full_filename is the filename of the original image (that the thumbnail is taken from). In the case of this example I’m creating thumbnails that have a height of 100 pixels and maintain their ratio, hence the width is variable.
The above can be made a lot more compact, but I’ve expanded it out to make it easier to follow.
By the time the code has finished, if the thumbnail didn’t already exist, it now does. Make sure the folder that the thumbnails are stored in has the appropriate permissions though!


Written by
David Artiss. Published 3 years, 4 months ago. Last modified 1 week ago. In categories
Tips.
My earlier issues with my router have been fixed! But I’m not quite sure what it was.
Last night, after having done some research on the ‘net, I decided to try and sort the problem out. First of all I removed the WEP security (yes, WEP) and tried the Wii… still not connecting. So I turned WEP back on, but at the same time turned the wireless off and on again. I then changed the channel to 11.
I then tried the Wii again… success. And the SoundBridge came on too.
Ok, so it sounds like there was interference on the channel I was on. Except, according to NetStumbler, nobody was and I was getting a clear frequency before. I think when I got my new router I set it to channel 3, but having looked at my past post on changing channels I think I was on 4. Now that might explain why the problems have only started since I got the new router, but I don’t understand what the channel issue was.
Oh well, NetStumbler shows channel 11 to be coming in loud and incredibly clear and all now appears well. But still, all a bit strange.


Written by
David Artiss. Published 3 years, 4 months ago. Last modified 1 week ago. In categories
Comment,
News,
Tips.
TomTom have introduced a great new way to update your maps. Using their PC application, TomTom Home, you can pay a quarterly fee and this will ensure you have all the latest maps.
Prices apparently start from £7.95 a quarter – UK maps for my TomTom One (v2) cost £15 per quarter.
Considering last year I was awaiting their Christmas sale and managed to secure a yearly map update for, a then, bargain price of £40, this is an excellent deal.
And I don’t have to faff about waiting for a sale 

