It is currently April 27th, 2024, 5:42 pm

[BUG]Image Directory Error

Report bugs with the Rainmeter application and suggest features.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

[BUG]Image Directory Error

Post by KreAch3R »

Hello,

I 've noticed this problem a while ago, but never gave me a proper chance to describe it. So, you have the regular weather skin, working correctly, with this weather icon meter:

Code: Select all

[MeterIcon]
MeasureName=mWeatherIcon
Meter=Image
ImageName=Weather\%1
X=120
Y=15
Antialias=1
If you take a look at the log, though, you get this, every time you refresh it:
Image

The error isn't permanent, is one-time-per-refresh only.

If you copy the Weather icons in the same directory as the .ini, and use this:

Code: Select all

[MeterIcon]
MeasureName=mWeatherIcon
Meter=Image
ImageName=%1
X=120
Y=15
Antialias=1
The error isn't replicated. I guess the error is triggered because the measure hasn't got a value yet, from Webparser, but then why it doesn't get triggered if I change directory?

I even try to implement the approach of "Extra Operation in Calc" workaround, but if that's the answer, I didn't do it very well. :)

If I have to give it a timeframe, I 'd say I 've noticed it since the 2.2. betas.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

Re: [BUG]Image Directory Error

Post by ~Faradey~ »

maybe this will help :)

Code: Select all

[MeterIcon]
MeasureName=mWeatherIcon
Meter=Image
ImageName=%1
Path=Weather\ ; or full path to images
X=120
Y=15
Antialias=1
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: [BUG]Image Directory Error

Post by KreAch3R »

Yes it does. :) I haven't used the Path Key ever before. So, if it isn't a bug, consider the matter solved. :)
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: [BUG]Image Directory Error

Post by AlC »

KreAch3R wrote:I 've noticed this problem a while ago, but never gave me a proper chance to describe it.
I know this. :)

I had the absolute same problem and now it's solved. Thanks KreAch3R and Faradey.
Rainmeter - You are only limited by your imagination and creativity.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: [BUG]Image Directory Error

Post by MerlinTheRed »

Using Path= doesn't solve the problem for me. Even if I give the WebParser some default value for errors it doesn't use that default value (probably because it just doesn't have a value yet and nothing went wrong). I don't know if you can really call this a bug though because the image actually doesn't exist when it's loaded the first time. I think it should be looked into though, because it's not pretty and it happens very commonly (everybody and his mother uses a weather skin).
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

Re: [BUG]Image Directory Error

Post by ~Faradey~ »

MerlinTheRed
can you give an example code or better to show code where you have this issue?
i'm sure there is an answer or some workaround :)
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: [BUG]Image Directory Error

Post by MerlinTheRed »

Code: Select all

[Rainmeter]
Update=1000
Author=MerlinTheRed
MiddleMouseUpAction=!Refresh #CurrentConfig#
Blur=1
BlurRegion=1,0,0,120,120

[Metadata]
Name=Current Weather
Config=Metro
Description=Shows current conditions
Instructions=Click on the weather icon to go to the full forecast on weather.com
Version=1.00
Tags=Weather | Forecast
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Preview=
Variant=

[Variables]
@include=#ROOTCONFIGPATH#Metro\Variables.inc

RegExpGeneralAndCC=.*<head>.*<ut>(.*)</ut>.*<ud>(.*)</ud>.*<us>(.*)</us>.*<up>(.*)</up>.*<ur>(.*)</ur>.*</head>.*<loc id=.*<dnam>(.*)</dnam>.*<tm>(.*)</tm>.*<lat>(.*)</lat>.*<lon>(.*)</lon>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*</loc>.*<cc>.*<obst>(.*)</obst>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<t>(.*)</t>.*<icon>(.*)</icon>.*<bar>.*<r>(.*)</r>.*<d>(.*)</d>.*</bar>.*<wind>.*<s>(.*)</s>.*<d>(.*)</d>.*<t>(.*)</t>.*</wind>.*<hmid>(.*)</hmid>.*<vis>(.*)</vis>.*<uv>.*<i>(.*)</i>.*<t>(.*)</t>.*</uv>.*<dewp>(.*)</dewp>.*<moon>.*<icon>(.*)</icon>.*<t>(.*)</t>.*</moon>.*</cc>
;                                 1 temp unit    2 dist unit    3 speed unit   4 press unit   5 rain unit                        6 Location       7 time checked  8 latitude       9 longitude       10 sunrise time    11 sunset time                   12 weather station13 current Temp  14 Feels like    15 cc text      16 cc icon             17 pressure  18 press. trend              19 wind speed20 wind dir 21 dir text               22 humidity       23 visibility       24 uv lvl     25 uv lvl text         26 dew point               27 moon icon    28 moon phase text

;Measures
;======================================================================
;Some of these are disabled and not used. I still kept them to save work if one wants to make a more detailed weather skin.

[MeasureWeather]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=http://xml.weather.com/weather/local/#Location#?cc=*&unit=#Unit#&dayf=5
RegExp="(?siU)#RegExpGeneralAndCC#"
DecodeCharacterReference=1
StringIndex=1
UpdateRate=900

;Units
[UnitTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeather]
StringIndex=1

;Current Conditions

[CCTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeather]
StringIndex=13

[CCFeelsLike]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeather]
StringIndex=14

[CCIcon]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeather]
StringIndex=16
ErrorString=na


;Meters
;========================================================================================

[Placeholder]
Meter=IMAGE
X=0
Y=0
W=125
H=125
SolidColor=#Transparent#

[Background]
Meter=IMAGE
X=0
Y=0
W=120
H=120
SolidColor=#BackgroundColor#

[MeterCCIcon]
Meter=IMAGE
MeasureName=CCIcon
ImageName=%1.png
Path=#ROOTCONFIGPATH#Metro\Resources\weather\
ImageTint=#PrimeColor#
X=10
Y=10
W=60
H=60
LeftMouseUpAction=http://www.weather.com/weather/today/#Location#

[MeterCCTemp]
Meter=String
MeasureName=CCTemp
MeasureName2=UnitTemp
FontFace=#Font#
FontColor=#PrimeColor#
FontSize=20
StringAlign=Right
X=117
Y=64
Text=%1 °%2
AntiAlias=1

[MeterCCFeel]
Meter=String
MeasureName=CCFeelsLike
MeasureName2=UnitTemp
FontFace=#Font#
FontColor=#PrimeColor#
FontSize=11
StringAlign=Right
X=114
Y=94
Text=%1 °%2
AntiAlias=1

Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

Re: [BUG]Image Directory Error

Post by ~Faradey~ »

here you go)
try use this instead

Code: Select all

[MeterCCIcon]
Meter=IMAGE
MeasureName=CCIcon
Path=#ROOTCONFIGPATH#Metro\Resources\weather\
ImageTint=#PrimeColor#
X=10
Y=10
W=60
H=60
LeftMouseUpAction=http://www.weather.com/weather/today/#Location#
in this case ImageName=%1.png is not necessary
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: [BUG]Image Directory Error

Post by KreAch3R »

The error appears running your code, indeed. Removing the .png extension solves the problem, though. I think Rainmeter defaults to .pngs when there is no extension on ImageName=, that's why it works.

UPDATE: Faradey was faster. :) I tried with a "%1.jpg", and the error occured. This only solves the problem when we are using .pngs. So maybe we should treat it as a bug.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

Re: [BUG]Image Directory Error

Post by ~Faradey~ »

KreAch3R
ImageName=%1.jpg
+Path
or
ImageName=%1.png
+Path
=error
but if
ImageName=%1
+Path
when no extentions were setted Rainmeter will search for pngs by default, and when not found any will use some sort of default transparent layer, i guess that is why no error occurred...
Last edited by ~Faradey~ on July 5th, 2012, 7:18 pm, edited 1 time in total.