New Zealand Local Weather Forum

Weather Discussion => Members Websites and Weather Cams => Topic started by: beteljuice on February 15, 2015, 03:35:48 AM

Title: Webcam Thumbnailler / Cropping
Post by: beteljuice on February 15, 2015, 03:35:48 AM
The beteljuice has been playing again !

Whilst on another project it was mentioned they couldn't get a decent thumbnail to show current conditions.

Easy with php said the betejuice, It might be for you said the other.

So, the beteljuice has put something together where you can select your thumbnail size and easily pick the area of your (large) webcam pic that you want for a thumb.
This might be square or a vertical rectangle rather than the usual horizontal rectangle, depending upon what reference points you want displayed and your page layout.

> Another beteljuice plaything  (http://www.beteljuice.co.uk/betel_cumulus/crop/crop_index.php)<

From the page:

There are several ways that the cropped thumbnail can be achieved.
This will give the code for TWO different methods.

Pure CSS
Pros:

    NO php requirement
    Original image is loaded in the page and thus available eg. could be a full screen option.

Cons:

    Original image is loaded in the page, this could significantly affect download time !.


PHP Thumbnailer
Pros:

    Simple image call
    Small upload in the page.

Cons:

    None really.


Code for both the CSS method and a 'personal' PHP file will be created for you to cut 'n' paste.
Which you chose is up to you !

It may not work for all, tough :P
Title: Re: Webcam Thumbnailler / Cropping
Post by: JennyLeez on February 15, 2015, 01:50:26 PM
and here is my test so far :)
Thank beteljuice.

Gisborne West (http://wairoa.net/gisborne-west/index.php)
Title: Re: Webcam Thumbnailler / Cropping
Post by: beteljuice on February 16, 2015, 08:33:22 AM
What ?

Nobody even wants to 'play' and see what it does  :o
Title: Re: Webcam Thumbnailler / Cropping
Post by: TonyC on February 16, 2015, 11:53:00 AM
I did give it a quick try.
My webserver is on my local network.
It can't find the file when I use the url:- http://192.168.1.137/Weatherfiles/webcam2.jpg which is the web server local ip,  to resize the picture.
Haven't tried using localhost or another browser (using Firefox). Might have another look when there's less real work to do.
cheers
TC
Title: Re: Webcam Thumbnailler / Cropping
Post by: beteljuice on February 16, 2015, 03:00:08 PM
I don't get that in a browser either ! - do you mean http://203.99.134.247/Weatherfiles/webcam2.jpg ?
Title: Re: Webcam Thumbnailler / Cropping
Post by: TonyC on February 16, 2015, 11:20:17 PM
I still don't get any graphic come up to resize, though it did move to the next screen. Maybe it's because the server is "in house" on the same internal network as the workstation. Not to worry.
Title: Re: Webcam Thumbnailler / Cropping
Post by: beteljuice on February 17, 2015, 12:04:34 AM
@TonyC

It can't go to the second screen unless it passes various checks.
I just tried it and it works, although the image itself looks like a spiders web in a fog ATM  :D
Title: Re: Webcam Thumbnailler / Cropping
Post by: TonyC on February 17, 2015, 07:59:42 AM
That's because it's night and has IR.
All I get is a blank thumbnail box. I'll give it a go when I'm off site at my Christchurch home.
cheers
TC
Title: Re: Webcam Thumbnailler / Cropping
Post by: TonyC on February 17, 2015, 05:07:57 PM
I'm now in Christchurch and yes it works fine.
The webserver and workstation obviously have to be on different networks to get the code generator to operate.