Tuesday, April 15, 2008

New Webcam Interface - ready to embed in your site!

Finally I implemented a modification in the way how the the Leeds Met Headingley Webcam picture is shown. In the original version, a full 640x480 image has been sent each minute to the sites displaying it, even if the display was then resized in the <img> tag. This meant that more data were transmitted than were required.

I now utilised the hidden capabilities of PHP and the GD2 graphics package to actually resize the image before it is being sent out. Works fine!

For anyone who wants to embed the live updated web cam picture onto their own web page, here is the code:

<!----------------------------------------------------------------------->
<iframe
scrolling="no"
width="100%"
height="250"
frameborder="0"
src="http://creativetech.inn.leedsmet.ac.uk/_LiveCam/index.php?w=280&h=210&t=Leeds Met: Headingley Campus" >
<!-- parameters: w=imagewidth, h=imageheight, t=captiontext -->
</iframe>
<!----------------------------------------------------------------------->

And this is the picture, resulting from the above code:

No comments: