Author Topic: wxStory 3.0  (Read 8873 times)

0 Members and 1 Guest are viewing this topic.

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1825
    • Maumelle Weather
Re: wxStory 3.0
« Reply #50 on: June 30, 2022, 11:31:51 AM »
527 files cleared from cache.  Issue persists.
wsdata_bis.php, wsdata_grr.php showed up after I tested the page.  Plus a couple of matching wsimg files.

Hi 92merc,

I can see the images for Bismarck at this time on your webpage. You may want to try clearing your browser cache and see if that resolves the issue.

Hope this helps,

John
GR2AE, GR3, Cumulus

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1314
  • BismarckWeather.net
    • BismarckWeather.net
Re: wxStory 3.0
« Reply #51 on: June 30, 2022, 12:03:38 PM »
Looks to be a Firefox issue.  New FF 102 doesn't like it.  Chrome and Edge are fine.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #52 on: June 30, 2022, 12:44:34 PM »
Same here, bad in FF but OK in Chrome.  Maybe there's a FF expert out there that can point us to something in about:config that may have changed.

But why is it picking on Bismarck?
« Last Edit: June 30, 2022, 12:51:05 PM by jmcmurry »

Forum Search and Google Can be Your Best Friends

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #53 on: June 30, 2022, 07:06:07 PM »
hunter362, lets try this:

In your script settings change to $ws_mapfolder   = './images2/ then create that folder on the server and put WS_map.png in it.  That way we've got everything "fresh".  We can write our story images to wscache so there should be no reason that we can't write to this folder.

- Jim
« Last Edit: June 30, 2022, 07:12:30 PM by jmcmurry »

Forum Search and Google Can be Your Best Friends

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: wxStory 3.0
« Reply #54 on: June 30, 2022, 08:46:35 PM »
Looks to be a Firefox issue.  New FF 102 doesn't like it.  Chrome and Edge are fine.

Yup, I just updated FF on my MacBook and now I see the problem.

Below are what I get if I inspect the image in Safari and then in Firefox.

 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]

So for some reason firefox thinks it can't load it. I'll see if I can figure out anything.
« Last Edit: June 30, 2022, 08:48:25 PM by Jasiu »
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: wxStory 3.0
« Reply #55 on: June 30, 2022, 08:56:22 PM »
This may have something to do with it...

The file on the NWS site is:

  Tab2FileL.png?020f87cf059e08a23be281de8ae0790c

Somehow that gets transformed into wsimg_bis_Tab2FileL.png-6ce9d44e0ebc8de245e961dc1b8.e3b as the file name loaded into the cache. Firefox is probably barfing at the ".e3b" suffix.  If I try to load

  https://www.bismarckweather.net/wscache/wsimg_bis_Tab2FileL.png-6ce9d44e0ebc8de245e961dc1b8.e3b

I get this error:

Quote
Content Encoding Error

An error occurred during a connection to www.bismarckweather.net.

    Please contact the website owners to inform them of this problem.

I don't use this script but I'll download it to see why/how the parameter after the "?" in the URL is handled.

https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #56 on: June 30, 2022, 09:44:37 PM »
It's a cache somewhere that needed to expire.  Bismarck now works fine for me on both my servers with FF.   ](*,)


Forum Search and Google Can be Your Best Friends

Offline hunter362

  • Member
  • *
  • Posts: 9
    • Fairmount Hill's Weather
Re: wxStory 3.0
« Reply #57 on: June 30, 2022, 11:19:47 PM »
hunter362, lets try this:

In your script settings change to $ws_mapfolder   = './images2/ then create that folder on the server and put WS_map.png in it.  That way we've got everything "fresh".  We can write our story images to wscache so there should be no reason that we can't write to this folder.

- Jim
God Bless America!  That worked, changed owner and group to www-data permissions to 0755 and it WORKS fine now! Thank you Jim
and BTW, excellent job on this script!

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #58 on: July 01, 2022, 06:08:01 AM »
Outstanding!!

Forum Search and Google Can be Your Best Friends

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1314
  • BismarckWeather.net
    • BismarckWeather.net
Re: wxStory 3.0
« Reply #59 on: July 01, 2022, 09:19:09 AM »
I tried making the images2 folder and change my script.  No change for me.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: wxStory 3.0
« Reply #60 on: July 01, 2022, 09:50:05 AM »
I tried making the images2 folder and change my script.  No change for me.

I still don't see the first image on your page either, despite the fact that the image (and file name) have both changed.

https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #61 on: July 01, 2022, 01:26:47 PM »
92merc, the /images2/ fix was for hunter362's map problem. 

Your FF problem is a mystery even though it straightened out for my FF.

- Jim

Forum Search and Google Can be Your Best Friends

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: wxStory 3.0
« Reply #62 on: July 01, 2022, 02:55:56 PM »
I sent 92merc the following change to test and it seems to work now.

Code: [Select]
//  $html = preg_replace("/\.png\?(.+?)/" , ".png " , $html);               // cut off random numbering of png
//  $html = preg_replace("/\.jpg\?(.+?)/" , ".jpg " , $html);               // cut off random numbering of jpg
//  $html = preg_replace("/\.gif\?(.+?)/" , ".gif " , $html);               // cut off random numbering of jpg
  $html = preg_replace("/\.png\?[^\"]+/" , ".png" , $html);               // cut off random numbering of png
  $html = preg_replace("/\.jpg\?[^\"]+/" , ".jpg" , $html);               // cut off random numbering of jpg
  $html = preg_replace("/\.gif\?[^\"]+/" , ".gif" , $html);               // cut off random numbering of jpg

The previous code was just replacing the "?" character in the URL with a space, which then led to the weird file name for the cache. The idea with the changed code is to remove the "?" and everything beyond until a quote mark is reached.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #63 on: July 03, 2022, 01:26:45 PM »
I've updated the script and Version 3.08 is now available in the first post in this thread.

A big thanks to 92merc for identifying the problem and to Jaisu for investigating and providing the fix.

- Jim

Forum Search and Google Can be Your Best Friends

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #64 on: August 05, 2022, 06:56:18 AM »
I've once more updated the script and Version 3.09 is now available in the first post in this thread.

It fixes some problems with resizing the Weather Story images.

- Jim

Forum Search and Google Can be Your Best Friends

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: wxStory 3.0
« Reply #65 on: August 18, 2022, 11:31:30 AM »
Jim,

I'm noticing an issue you fixed back in April has returned...at least for me. This had to do with the image being mashed down a bit and quite distorted. I was seeing this recently again on 3.07 so I installed 3.09 and it still occurs.

It happens for me on SHV. I checked other sites and most were correct. However, both TBW and JAX had the same issue as I did. There is one very common thing about all 3 of these  'distorted' images. They are radar images rather than normal graphics which all the 'working' sites I look at had.

Hope this helps.

Thanks,

Steve

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: wxStory 3.0
« Reply #66 on: August 18, 2022, 02:03:04 PM »
What's your URL Steve?
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: wxStory 3.0
« Reply #67 on: August 18, 2022, 02:51:10 PM »
What's your URL Steve?

https://www.tylertexasweather.com/wxstory.htm

This is running the 3.07 version. I downloaded the 3.09 version and tested it, but got the same result 3.07 gives me.

Steve

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: wxStory 3.0
« Reply #68 on: August 19, 2022, 09:09:42 AM »
SHV isn't showing a radar at this time, but JAX is.  The problem is in this line:

Code: [Select]
<td style="text-align:center"><img src="./wscache/wsimg_jax_KJAX_loop.gif-3a5e55a06dccdad1c7da5476437.6a8" style="width: 700px; height: 400px;" alt=" " /></td>
 

It's the height CSS parameter that is keeping the image from displaying properly. If I interactively remove it (using Firefox developer tools), it's fine.

I'm not familiar enough with the code to determine WHY that height gets in there.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: wxStory 3.0
« Reply #69 on: August 19, 2022, 09:57:03 AM »
I also notice that if you click on another tab (like Today) and then back to the radar, it gets the height right. But height isn't really needed in this case as the browser will do the right thing given the width and keep it proportional.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: wxStory 3.0
« Reply #70 on: August 19, 2022, 10:02:48 AM »
Jasiu,

Thanks very much for the pointer.

For whatever reason, that "400px" value is set with

$imgheight = 400;

at around line 615 in wxStory_inc.php.

When I change it, it changes the height of the radar images but, fortunately, doesn't appear to change the height of anything else. The radar images are 600 wide and 550 tall. However, the script allows you to set a width that is used across the script. I use 700px. If I set the $imheight = 550, I do get a taller image, but it's still disproportionate. Since my width is 700, I tried a height of 642 to keep the radar image proportionate to 600x550. And this works. You can tell it's slightly stretched, but it looks a lot better than being smashed down.

Thanks again for the assistance.

Steve

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #71 on: August 20, 2022, 06:06:57 AM »
I'm sorry, bu I'm going through a "week from hell" and will have time to look at this next week.  - Jim

Forum Search and Google Can be Your Best Friends

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: wxStory 3.0
« Reply #72 on: August 20, 2022, 09:04:14 AM »
I'm sorry, bu I'm going through a "week from hell" and will have time to look at this next week.  - Jim

Hey Jim,

There's no hurry for me. Changing the $imgheight variable has circumvented the issue for me for now.

Steve

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: wxStory 3.0
« Reply #73 on: August 20, 2022, 10:47:25 AM »
Another fix might be to modify line 756:

Code: [Select]
<td style="text-align:center"><img src="<?php echo $wsimg ?>" style="width: <?php echo $tablewdth;  ?>px; height: <?php echo $imgheight ?>px;" alt=" " /></td>

and get rid of the height completely.

Code: [Select]
<td style="text-align:center"><img src="<?php echo $wsimg ?>" style="width: <?php echo $tablewdth;  ?>px;" alt=" " /></td>

The browser should set a proportional height to keep the image height/width ratio the same as the original. That should work if even if the source (weather.gov) changes the image dimensions in the future.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: wxStory 3.0
« Reply #74 on: August 20, 2022, 02:52:44 PM »
Jasiu,

Thanks for the suggestion. I tried that and it works for me. And, as you said, it still proportions the image correctly even if the NWS decides to reformat the size of the radar image.

Appreciate the assistance.

Steve