It is currently March 29th, 2024, 3:15 pm

Image not showing...

Get help with creating, editing & fixing problems with skins
User avatar
NeefoPlays
Posts: 6
Joined: June 27th, 2017, 10:01 am

Image not showing...

Post by NeefoPlays »

Hi all,
One of the skins that I was using suddenly stopped showing the image it's supposed to show :/, It used to work which is odd, I tried refreshing, restarting rain-meter and I also re-installed it. Here is the current skin's code:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1


[Variables]
; Post the YouTube channel About page below.
Channel=https://www.youtube.com/channel/UCU-Dvfw0B6DjfGszd4ZcF8w/about

;Any installed Windows Font Supported
Font=True Lies

; Time between checks/updates for stats/picture
UpdateTime=3600

;Font color in RGB format
RGBFontColor=255,255,255

[BG]
Meter=Image
H=200
W=700


[StatsSubs]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=(?siU)subscribers.*>(.*)</span>
StringIndex=1
UpdateRate=#UpdateTime#
debug=2

[StatsViews]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=about-stat.*> &bull; <b>(.*)</b> views
StringIndex=1
UpdateRate=#UpdateTime#

[StatsUsername]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=meta property="og:title" content="(.*)">
StringIndex=1
UpdateRate=#UpdateTime#





[StatsPic]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=(?siU)channel-header-profile-image.* src="(.*)"
StringIndex=1
UpdateRate=#UpdateTime#

[Subscribers]
Meter=String
MeasureName=StatsSubs
StringAlign=Right
Y=50
X=490
FontSize=20
FontFace=#Font#
FontColor=#RGBFontColor#
AntiAlias=1

[Views]
Meter=String
MeasureName=StatsViews
StringAlign=Right
Y=90
X=490
FontSize=20
FontFace=#Font#
FontColor=#RGBFontColor#
AntiAlias=1

[Username]
Meter=String
MeasureName=StatsUsername
StringAlign=Right
X=565
Y=1
FontFace=#Font#
FontSize=28
FontColor=#RGBFontColor#
StringStyle=Bold
AntiAlias=1

[ProfilePictureDownload]
Measure=Plugin
Plugin=WebParser
UpdateRate=#UpdateTime#
Url=[StatsPic]
StringIndex=1
DynamicVariables=1
Download=1


[ProfilePicture]
Meter=Image
MeasureName=ProfilePictureDownload
X=580
Y=0
H=120
W=120

[SubscribersLabel]
Meter=String
DynamicVariables=1
Text=SUBS
StringAlign=Right
X=560
Y=57
AntiAlias=1
FontFace=#Font#
FontSize=15
FontColor=#RGBFontColor#

[ViewsLabel]
Meter=String
DynamicVariables=1
Text=VIEWS
StringAlign=Right
X=560
Y=96
AntiAlias=1
FontFace=#Font#
FontSize=15
FontColor=#RGBFontColor#
It looks like this;
asd.png
when it should look something like this;
asdasd.png
Many Regards,
NeefoPlays
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Image not showing...

Post by eclectic-tech »

The web page probably changed it's code... the RegExp in your code no longer finds a match.
You will need to modify the RegExp to capture the image source in the new code.
neefo.png
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image not showing...

Post by balala »

NeefoPlays wrote:One of the skins that I was using suddenly stopped showing the image it's supposed to show :/, It used to work which is odd, I tried refreshing, restarting rain-meter and I also re-installed it. Here is the current skin's code:
As eclectic-tech said, if the skin was working, showing the image and then suddenly stopped, probably something changed in the code of the page. But don't worry, I think there is a solution.

First I have to say for me nor the [StatsSubs] and nor the [StatsViews] measure doesn't work. I don't get anything.
A second remark would be that the WebParser measures (WebParser is no longer a plugin, now it's a measure!) should have a parent - child construction. In your code, each WebParser (plugin) measure is a parent measure, which although works, is not a good idea.

All these being said, here is a (probably) working solution. You have to follow a few steps, to make the skin to download the image:
  • First modify the URL option of the [ProfilePictureDownload] measure, adding a http: before the [StatsPic] measure name: Url=[color=#FF0000]http:[/color][StatsPic]. But I'd go further and would also add a &: Url=http:[[color=#FF0000]&[/color]StatsPic]. You can find out why in the last paragraph here: https://docs.rainmeter.net/manual/plugins/webparser/#URL.
  • Secondary, the [ProfilePictureDownload] measure downloads an image, it doesn't need the StringIndex option. Remove it (although this isn't something which could stop the measure to download the image).
  • Thirdly, when the [StatsPic] measure gets the URL of the image (this takes time, doesn't occur instantly), the [ProfilePictureDownload] measure should be updated. Or even better, I'd initially disable this [ProfilePictureDownload] measure and when [StatsPic] gets the URL, I'd enable and update it.
    For this last solution, add a Disabled=1 option to the [ProfilePictureDownload] measure. Then add the following option to the [StatsPic] measure: FinishAction=[!EnableMeasure "ProfilePictureDownload"][!CommandMeasure "ProfilePictureDownload" "Update"]. With this option, once the [StatsPic] measure gets the URL, it enables, then updates the [ProfilePictureDownload] measure.
Besides all these, I still would want to rewrite the code for a parent - child structure.
Please try the above solution and let me know if it does help. If it does, we'll try to rewrite the code as I said above.
User avatar
NeefoPlays
Posts: 6
Joined: June 27th, 2017, 10:01 am

Re: Image not showing...

Post by NeefoPlays »

balala wrote:As eclectic-tech said, if the skin was working, showing the image and then suddenly stopped, probably something changed in the code of the page. But don't worry, I think there is a solution.

First I have to say for me nor the [StatsSubs] and nor the [StatsViews] measure doesn't work. I don't get anything.
A second remark would be that the WebParser measures (WebParser is no longer a plugin, now it's a measure!) should have a parent - child construction. In your code, each WebParser (plugin) measure is a parent measure, which although works, is not a good idea.

All these being said, here is a (probably) working solution. You have to follow a few steps, to make the skin to download the image:
  • First modify the URL option of the [ProfilePictureDownload] measure, adding a http: before the [StatsPic] measure name: Url=[color=#FF0000]http:[/color][StatsPic]. But I'd go further and would also add a &: Url=http:[[color=#FF0000]&[/color]StatsPic]. You can find out why in the last paragraph here: https://docs.rainmeter.net/manual/plugins/webparser/#URL.
  • Secondary, the [ProfilePictureDownload] measure downloads an image, it doesn't need the StringIndex option. Remove it (although this isn't something which could stop the measure to download the image).
  • Thirdly, when the [StatsPic] measure gets the URL of the image (this takes time, doesn't occur instantly), the [ProfilePictureDownload] measure should be updated. Or even better, I'd initially disable this [ProfilePictureDownload] measure and when [StatsPic] gets the URL, I'd enable and update it.
    For this last solution, add a Disabled=1 option to the [ProfilePictureDownload] measure. Then add the following option to the [StatsPic] measure: FinishAction=[!EnableMeasure "ProfilePictureDownload"][!CommandMeasure "ProfilePictureDownload" "Update"]. With this option, once the [StatsPic] measure gets the URL, it enables, then updates the [ProfilePictureDownload] measure.
Besides all these, I still would want to rewrite the code for a parent - child structure.
Please try the above solution and let me know if it does help. If it does, we'll try to rewrite the code as I said above.



Thank you both for the reply, but it does not seem to work...
Here is the code with the solutions you suggested

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1



[Variables]
; Post the YouTube channel About page below.
Channel=https://www.youtube.com/channel/UCU-Dvfw0B6DjfGszd4ZcF8w/about

;Any installed Windows Font Supported
Font=True Lies

; Time between checks/updates for stats/picture
UpdateTime=3600

;Font color in RGB format
RGBFontColor=255,255,255

[BG]
Meter=Image
H=200
W=700


[StatsSubs]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=(?siU)subscribers.*>(.*)</span>
StringIndex=1
UpdateRate=#UpdateTime#
debug=2

[StatsViews]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=about-stat.*> &bull; <b>(.*)</b> views
StringIndex=1
UpdateRate=#UpdateTime#

[StatsUsername]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=meta property="og:title" content="(.*)">
StringIndex=1
UpdateRate=#UpdateTime#





[StatsPic]
Measure=Plugin
Plugin=WebParser
Url=http:[&StatsPic]
RegExp=(?siU)channel-header-profile-image.* src="(.*)"
StringIndex=1
UpdateRate=#UpdateTime#
FinishAction=[!EnableMeasure "ProfilePictureDownload"][!CommandMeasure "ProfilePictureDownload" "Update"]

[Subscribers]
Meter=String
MeasureName=StatsSubs
StringAlign=Right
Y=50
X=490
FontSize=20
FontFace=#Font#
FontColor=#RGBFontColor#
AntiAlias=1

[Views]
Meter=String
MeasureName=StatsViews
StringAlign=Right
Y=90
X=490
FontSize=20
FontFace=#Font#
FontColor=#RGBFontColor#
AntiAlias=1

[Username]
Meter=String
MeasureName=StatsUsername
StringAlign=Right
X=565
Y=1
FontFace=#Font#
FontSize=28
FontColor=#RGBFontColor#
StringStyle=Bold
AntiAlias=1

[ProfilePictureDownload]
Measure=Plugin
Plugin=WebParser
UpdateRate=#UpdateTime#
Url=[StatsPic]
DynamicVariables=1
Download=1
Disabled=1


[ProfilePicture]
Meter=Image
MeasureName=ProfilePictureDownload
X=580
Y=0
H=120
W=120

[SubscribersLabel]
Meter=String
DynamicVariables=1
Text=SUBS
StringAlign=Right
X=560
Y=57
AntiAlias=1
FontFace=#Font#
FontSize=15
FontColor=#RGBFontColor#

[ViewsLabel]
Meter=String
DynamicVariables=1
Text=VIEWS
StringAlign=Right
X=560
Y=96
AntiAlias=1
FontFace=#Font#
FontSize=15
FontColor=#RGBFontColor#
I tried adding the picture manually, but it would not show up...
Many Regards,
NeefoPlays
User avatar
NeefoPlays
Posts: 6
Joined: June 27th, 2017, 10:01 am

Re: Image not showing...

Post by NeefoPlays »

Ok so I just added the image manually;

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1


[Variables]
; Post the YouTube channel About page below.
Channel=https://www.youtube.com/channel/UCU-Dvfw0B6DjfGszd4ZcF8w/about

;Any installed Windows Font Supported
Font=True Lies

; Time between checks/updates for stats/picture
UpdateTime=3600

;Font color in RGB format
RGBFontColor=255,255,255

[BG]
Meter=Image
H=200
W=700


[StatsSubs]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=(?siU)subscribers.*>(.*)</span>
StringIndex=1
UpdateRate=#UpdateTime#
debug=2

[StatsViews]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=about-stat.*> &bull; <b>(.*)</b> views
StringIndex=1
UpdateRate=#UpdateTime#

[StatsUsername]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=meta property="og:title" content="(.*)">
StringIndex=1
UpdateRate=#UpdateTime#


[Subscribers]
Meter=String
MeasureName=StatsSubs
StringAlign=Right
Y=50
X=490
FontSize=20
FontFace=#Font#
FontColor=#RGBFontColor#
AntiAlias=1

[Views]
Meter=String
MeasureName=StatsViews
StringAlign=Right
Y=90
X=490
FontSize=20
FontFace=#Font#
FontColor=#RGBFontColor#
AntiAlias=1

[Username]
Meter=String
MeasureName=StatsUsername
StringAlign=Right
X=565
Y=1
FontFace=#Font#
FontSize=28
FontColor=#RGBFontColor#
StringStyle=Bold
AntiAlias=1

[ProfilePicture]
Meter=Image
ImageName=#@#Images\Logo.jpg
MeasureName=ProfilePictureDownload
X=580
Y=0
H=120
W=120

[SubscribersLabel]
Meter=String
DynamicVariables=1
Text=SUBS
StringAlign=Right
X=560
Y=57
AntiAlias=1
FontFace=#Font#
FontSize=15
FontColor=#RGBFontColor#

[ViewsLabel]
Meter=String
DynamicVariables=1
Text=VIEWS
StringAlign=Right
X=560
Y=96
AntiAlias=1
FontFace=#Font#
FontSize=15
FontColor=#RGBFontColor#
Many Regards,
NeefoPlays
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image not showing...

Post by balala »

NeefoPlays wrote:Thank you both for the reply, but it does not seem to work...
Here is the code with the solutions you suggested

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1



[Variables]
; Post the YouTube channel About page below.
Channel=https://www.youtube.com/channel/UCU-Dvfw0B6DjfGszd4ZcF8w/about

;Any installed Windows Font Supported
Font=True Lies

; Time between checks/updates for stats/picture
UpdateTime=3600

;Font color in RGB format
RGBFontColor=255,255,255

[BG]
Meter=Image
H=200
W=700


[StatsSubs]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=(?siU)subscribers.*>(.*)</span>
StringIndex=1
UpdateRate=#UpdateTime#
debug=2

[StatsViews]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=about-stat.*> &bull; <b>(.*)</b> views
StringIndex=1
UpdateRate=#UpdateTime#

[StatsUsername]
Measure=Plugin
Plugin=WebParser
URL=#Channel#
RegExp=meta property="og:title" content="(.*)">
StringIndex=1
UpdateRate=#UpdateTime#





[StatsPic]
Measure=Plugin
Plugin=WebParser
Url=http:[&StatsPic]
RegExp=(?siU)channel-header-profile-image.* src="(.*)"
StringIndex=1
UpdateRate=#UpdateTime#
FinishAction=[!EnableMeasure "ProfilePictureDownload"][!CommandMeasure "ProfilePictureDownload" "Update"]

[Subscribers]
Meter=String
MeasureName=StatsSubs
StringAlign=Right
Y=50
X=490
FontSize=20
FontFace=#Font#
FontColor=#RGBFontColor#
AntiAlias=1

[Views]
Meter=String
MeasureName=StatsViews
StringAlign=Right
Y=90
X=490
FontSize=20
FontFace=#Font#
FontColor=#RGBFontColor#
AntiAlias=1

[Username]
Meter=String
MeasureName=StatsUsername
StringAlign=Right
X=565
Y=1
FontFace=#Font#
FontSize=28
FontColor=#RGBFontColor#
StringStyle=Bold
AntiAlias=1

[ProfilePictureDownload]
Measure=Plugin
Plugin=WebParser
UpdateRate=#UpdateTime#
Url=[StatsPic]
DynamicVariables=1
Download=1
Disabled=1


[ProfilePicture]
Meter=Image
MeasureName=ProfilePictureDownload
X=580
Y=0
H=120
W=120

[SubscribersLabel]
Meter=String
DynamicVariables=1
Text=SUBS
StringAlign=Right
X=560
Y=57
AntiAlias=1
FontFace=#Font#
FontSize=15
FontColor=#RGBFontColor#

[ViewsLabel]
Meter=String
DynamicVariables=1
Text=VIEWS
StringAlign=Right
X=560
Y=96
AntiAlias=1
FontFace=#Font#
FontSize=15
FontColor=#RGBFontColor#
I tried adding the picture manually, but it would not show up...
That's normal it doesn't work. From the beginning, the [StatsPic] measure doesn't even returns the URL of the image, because you've put here the URL option which should have been used in the [ProfilePictureDownload] measure.
So, just for a clarification, use the following URL options:

Code: Select all

[StatsPic]
...
URL=#Channel#
...

[ProfilePictureDownload]
...
Url=http:[&StatsPic]
...
If you're using these URL options, I assure you the measures will work and the skin will download properly the image. Don't have to add it manually.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Image not showing...

Post by jsmorley »

Don't forget DyanmicVariables=1 where you use [&SectionVarible]
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image not showing...

Post by balala »

jsmorley wrote:Don't forget DyanmicVariables=1 where you use [&SectionVarible]
I didn't mention this, because in NeefoPlays's code is already added.