I was wondering if you can increase the size of the icons from the default size of 58x55 and if you can where in the script you change it. I changed my icons to 71x67 but they are scaled down to 58x55. Any help would be great.
Chuck
I was wondering if you can increase the size of the icons from the default size of 58x55 and if you can where in the script you change it. I changed my icons to 71x67 but they are scaled down to 58x55. Any help would be great.
Chuck
Were you referring to the current condition icon or to the NWS forecast icons?
If the current condition icon (in ajax-images), then you’ll need to change that in two places:
in ajax-dashboard.php change the width= and height= on the statement for the conditions
in ajaxWDwx.js do a similar change in the function ajax_wxIconJPG()
If it’s the NWS icons, you’ll have a lot of resizing to do … many of the icons are PoP stamped, so there are 10 icons for each icon with a PoP stamp.
Hope this helps…
Best regards,
Ken
I used a program that would do an entire directory so I put them in all in one directory and choose your size. I will and try and find the settings you where referring to.
Chuck
Those settings are for the current conditions not the Forecast Icons Ken. It is for the NWS Forecast Icons. I already have all of them resized to 71x67. But they are being rescaled to 58x55. I have looked in ajaxdashboard.php, advforecast2.php, ajaxWDwx.js, header.php, top.php, Settings.php and found nothing about the Forecast Icons. Maybe I am looking in the wrong place.
Chuck
I did change this setting in the advforecast2.php script but that did not help.
$icon .= '<img src="/forecast/images/' . $iconimage . '" height="71" width="67" ' .
'alt="' . $condition . '" title="' . $condition . '" />
' . $condition;
Chuck,
The code snippet you showed is only part of the Zone forecast parser (where we create an appropriate icon based on the text in the zone forecast). The point-printable forecast has width=“55” height=“58” already in it from the HTML from the NWS, and we don’t currently modify that or process it at all. That’s why it doesn’t show on your main screen or the wxforecast.php page.
To add that processing, you’d need to change advforecast2.php
preg_match_all('|
([^<]+)(<span.*</span>.*)|is',$forecasticons[$i],$matches);
to
$forecasticons[$i] = preg_replace('|width="55" height="58"|is','width="67" height="71"',$forecasticons[$i]);
preg_match_all('|
([^<]+)(<span.*</span>.*)|is',$forecasticons[$i],$matches);
Best regards,
Ken
That did the trick Ken. Thanks for taking the time to do this.
Chuck
If you want a batch convert program for images take a look at FastStone Photo Resizer, I’ve used it a lot for resizing my photos for the web.
Stuart
Didn’t work for me :roll: however if my page is refreshed you get a large forecast icon which returns to the small one in just seconds. This has been happening since the beginning of using the alternate template.
Lulu are you referring to the current conditions icon right above the temp or the forecast icons. If you want the current conditions I have to to into your ajaxWDwx.js and change the line where the width and the height are.
function ajax_wxIconJPG ( iconWD ) {
// perform a lookup and return the graphic for the condition icon (using NWS icons)
$iconList = new Array(
"skc.jpg", // 0 imagesunny.visible
"nskc.jpg", // 1 imageclearnight.visible
"bkn.jpg", // 2 imagecloudy.visible
"sct.jpg", // 3 imagecloudy2.visible
"nbkn.jpg", // 4 imagecloudynight.visible
"sct.jpg", // 5 imagedry.visible
"fg.jpg", // 6 imagefog.visible
"hazy.jpg", // 7 imagehaze.visible
"ra.jpg", // 8 imageheavyrain.visible
"few.jpg", // 9 imagemainlyfine.visible
"mist.jpg", // 10 imagemist.visible
"nfg.jpg", // 11 imagenightfog.visible
"nra.jpg", // 12 imagenightheavyrain.visible
"novc.jpg", // 13 imagenightovercast.visible
"nra.jpg", // 14 imagenightrain.visible
"nshra.jpg", // 15 imagenightshowers.visible
"nsn.jpg", // 16 imagenightsnow.visible
"ntsra.jpg", // 17 imagenightthunder.visible
"ovc.jpg", // 18 imageovercast.visible
"bkn.jpg", // 19 imagepartlycloudy.visible
"ra.jpg", // 20 imagerain.visible
"ra.jpg", // 21 imagerain2.visible
"shra.jpg", // 22 imageshowers2.visible
"ip.jpg", // 23 imagesleet.visible
"ip.jpg", // 24 imagesleetshowers.visible
"sn.jpg", // 25 imagesnow.visible
"sn.jpg", // 26 imagesnowmelt.visible
"sn.jpg", // 27 imagesnowshowers2.visible
"skc.jpg", // 28 imagesunny.visible
"scttsra.jpg", // 29 imagethundershowers.visible
"hi_tsra.jpg", // 30 imagethundershowers2.visible
"tsra.jpg", // 31 imagethunderstorms.visible
"nsvrtsra.jpg", // 32 imagetornado.visible
"wind.jpg", // 33 imagewindy.visible
"ra1.jpg", // 34 stopped rainning
"windyrain.jpg" // 35 windy/rain (new with V2.11)
);
if (iconWD >= 0 && iconWD <= 35) {
return ("<img src=\"" + imagedir + "/" + $iconList[iconWD] + "\" " +
"width=\"112\" height=\"108\" alt=\"Current condition icon\" />" );
} else {
return '';
}
Also in the ajaxdashboard as well.
<span class="ajax" id="ajaxconditionicon2">
<img src="<?php echo $imagesDir . newIcon($iconnumber) ?>"
alt="<?php $t1 = preg_replace('|<.*>|s',", ",$current_summary);
echo $t1; ?>"
title="<?php echo $t1; ?>" height="108" width="112" />
</span>
</td>
</tr>
Chuck
Thanks Chuck…but all my current condition images are *.gif.
Lulu I just checked your main page and all of you icons are jpeg. The only thing that is a .gif is the moon icon.
Chuck
:dontknow:
"day_clear.gif", // 0 imagesunny.visible
"night_clear.gif", // 1 imageclearnight.visible
"day_partly_cloudy.gif", // 2 imagecloudy.visible
"day_partly_cloudy.gif", // 3 imagecloudy2.visible
"night_partly_cloudy.gif", // 4 imagecloudynight.visible
"day_clear.gif", // 5 imagedry.visible
"fog.gif", // 6 imagefog.visible
"haze.gif", // 7 imagehaze.visible
"day_heavy_rain.gif", // 8 imageheavyrain.visible
"day_mostly_sunny.gif", // 9 imagemainlyfine.visible
"mist.gif", // 10 imagemist.visible
"fog.gif", // 11 imagenightfog.visible
"night_heavy_rain.gif", // 12 imagenightheavyrain.visible
"night_cloudy.gif", // 13 imagenightovercast.visible
"night_rain.gif", // 14 imagenightrain.visible
"night_light_rain.gif", // 15 imagenightshowers.visible
"night_snow.gif", // 16 imagenightsnow.visible
"night_tstorm.gif", // 17 imagenightthunder.visible
"day_cloudy.gif", // 18 imageovercast.visible
"day_partly_cloudy.gif", // 19 imagepartlycloudy.visible
"day_rain.gif", // 20 imagerain.visible
"day_rain.gif", // 21 imagerain2.visible
"day_light_rain.gif", // 22 imageshowers2.visible
"day_sleet.gif", // 23 imagesleet.visible
"day_sleet.gif", // 24 imagesleetshowers.visible
"day_snow.gif", // 25 imagesnow.visible
"day_snow.gif", // 26 imagesnowmelt.visible
"day_snow.gif", // 27 imagesnowshowers2.visible
"day_clear.gif", // 28 imagesunny.visible
"day_tstorm.gif", // 29 imagethundershowers.visible
"day_tstorm.gif", // 30 imagethundershowers2.visible
"day_tstorm.gif", // 31 imagethunderstorms.visible
"tornado.gif", // 32 imagetornado.visible
"windy.gif", // 33 imagewindy.visible
"day_partly_cloudy.gif", // 34 stopped rainning
"windyrain.gif" // 35 windy/rain (new with V2.11)
);
if (iconWD >= 0 && iconWD <= 35) {
return (“<img src="” + imagedir + “/” + $iconList[iconWD] + "" " +
“width="112" height="108" alt="Current condition icon" />” );
Lulu,
Go to the next section right below that in your ajaxWDwx.js. Those are the ones that you are using which are the jpeg’s and want to change the size.
Chuck
You’re right…my bad…sorry…I see they are all jpg.
Just trying to help you out Lulu.
Chuck
I’m trying to do all this while cooking some crawfish and fresh shrimp outside so I’ll wait until after dinner to do anymore so I can concentrate on what I’m doing. I think my multi-tasking days may be over
And you already know that I appreciate your help. Many times misinterpretations of my responses happen and I unintentionally come across as terse and cross…Cajuns don’t have a mean bone in their bodies.
Well of course I do Lulu that’s what this forum is all about to help everyone out if we can.
Chuck
LuLu,
You need to invite everyone down for some of those shrimp and crawfish!
Michael
What a get-together that would be :smilecolros: