Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

image resize help

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
User avatar
robynfali
Posts: 1076
Joined: Sat 31 Jul 2010 10:34 pm
Weather Station: Vantage Vue
Operating System: Windows XP
Location: Anglesey, North Wales, UK
Contact:

image resize help

Post by robynfali »

Hi all!!

I have been messing about with my mobile sites, putting a link in for my webcam image, but i want to take it a little further.

I have the iphone one

http://valley-weather.co.uk/mobile/index.html#_home

and the android one

http://valley-weather.co.uk/android/

What i would like to do, is to put a scale down image into both of these, that could possibly be clickable so that they can view it full (mobile) screen.

I have done a bit of a search, but all I am finding is lectures on why not to do it!, i don't want to have to process a 2nd image purely for mobile because as far as I can see yawcam doesn't allow a 2nd instance using the same camera.

So basically all i am after is how you scale the image using html, and also possibly a suggestion on what size to rescale it to. Aiming at android & iphones?

Thanks in advance
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: image resize help

Post by nitrx »

Well you can put the image in a html page and resize it with the height and widht tags

http://valley-weather.co.uk/images/webcam.jpg is 640 by 480 pixels if you use the html code

<img src="http://valley-weather.co.uk/images/webcam.jpg" width=320 height=240></img> the image wil be the half http://www.htmlcodetutorial.com/images/_IMG_WIDTH.html some examples but you should use the tags in a html page

by example

<html>
<body>
<img src="http://valley-weather.co.uk/images/webcam.jpg" width=320 height=240></img>
</body>
</html>
You can adjust the values width and height but it's better to keep the dimensions the same.

will do , perhaps there are alternative solutions this is a simple way of resizing for displaying in a webpage, the pageload wil be the same for the visitor of the page there is not a smaller image loaded to the adroid phone or tablet.
User avatar
robynfali
Posts: 1076
Joined: Sat 31 Jul 2010 10:34 pm
Weather Station: Vantage Vue
Operating System: Windows XP
Location: Anglesey, North Wales, UK
Contact:

Re: image resize help

Post by robynfali »

Thanks mate, having a mess about with it now
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: image resize help

Post by mcrossley »

Rob, that will work but the reason for the lectures is that does not alter the size of the file that has to be downloaded. To do a 'proper job' then the image could be resized on our server using PHP. Then a small thumbnail is downloaded to the phone, and only if the user elects to zoom it up in size would the full size image be downloaded.

How to implement that I defer to the PHP experts. :roll:
User avatar
robynfali
Posts: 1076
Joined: Sat 31 Jul 2010 10:34 pm
Weather Station: Vantage Vue
Operating System: Windows XP
Location: Anglesey, North Wales, UK
Contact:

Re: image resize help

Post by robynfali »

I do realise the proper way is to resize the image, but i do wonder how long it would take to download a 640x480 over 3g these days? I don't have PHP running on mine at the moment. Paul graciously helped me last year to do a complete php thing, then i fell onto Jacques templates which are just about my level of understanding
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: image resize help

Post by gemini06720 »

mcrossley wrote:How to implement that I defer to the PHP experts. :roll:
Mark, the best way to create thumbnail image (as the thumbnail will have a smaller size than a shrunk down image using the 'width/height' parameters) is to use either a PHP script or a PHP class - some of the scripts available can even create 'on-the-fly' thumbnails...

I am using such as script to create an animated image of the radar screens - at the bottom of the left-hand menus on all of my [link removed] pages.
Last edited by gemini06720 on Sat 08 Jun 2013 11:18 am, edited 1 time in total.
TNETWeather

Re: image resize help

Post by TNETWeather »

If your webhost has it, you can use Imagemagick to resize an image.

Like:

Code: Select all

convert original_image.jpg -resize 25% new_image.png
Reduces the size by 25%... Note that it also changed the image format from jpg to png which works better for smaller images (less lossy look).

You can give it exact dimension sizes as well. like:

Code: Select all

convert original_image.jpg -resize 120x120  new_image.png
If you don't have that, chances are your PHP has GD built in. There are lots of scripts you can use to then do the same thing all within PHP.

I use convert a ton... for everything from NOAA images, to converting 720x1280 images for Droid Splash Screens into reasonable size thumbnails.
ronstrong
Posts: 4
Joined: Sat 19 May 2012 8:12 am
Weather Station: wh1080
Operating System: Windows XP SP3
Location: United Kingdom
Contact:

Re: image resize help

Post by ronstrong »

Why an android page when the 'iphone' one works great on android?

Could I have a copy of your template?

I;d just use the tags to resize

thanks

ron

Ron
http://www.chapelallerton.org/weather/
User avatar
robynfali
Posts: 1076
Joined: Sat 31 Jul 2010 10:34 pm
Weather Station: Vantage Vue
Operating System: Windows XP
Location: Anglesey, North Wales, UK
Contact:

Re: image resize help

Post by robynfali »

Gives people a choice on information all on one page, or more information on a few pages, if you want the iphone template, go to the Wiki and search for ICumulus for iPhone :-)
Post Reply