Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Is https://imgsrv.roll20.net/?src still needed for images on character sheets?

November 01 (3 years ago)
Peter B.
Plus
Sheet Author

On the sheet that I maintain, the logo image url looks like this: https://imgsrv.roll20.net/?src=https://i.stack.imgur.com/CN5gs.png

Is the prefix https://imgsrv.roll20.net/?src= still needed or is it a very old deprecated thing?

November 01 (3 years ago)
GiGs
Pro
Sheet Author
API Scripter

I dont know if you ever needed to insert that manually, but if you did once upon time, you don't now.

I think roll20 does process all images through an image server, but that is transparent to sheet creators and users. Just use the normal image link, but ideally, make sure it is saved in your sheet's github site so that it doesnt get lost if anything happens at the remote host.

November 01 (3 years ago)

Edited November 01 (3 years ago)
vÍnce
Pro
Sheet Author


Peter B. said:

On the sheet that I maintain, the logo image url looks like this: https://imgsrv.roll20.net/?src=https://i.stack.imgur.com/CN5gs.png

Is the prefix https://imgsrv.roll20.net/?src= still needed or is it a very old deprecated thing?

I simply link to the image on the repo in the sheet code

but you'll notice(using the browser's dev tools) that roll20 will convert the link regardless. Not sure why... Perhaps security reasons. IDK
<img src="https://imgsrv.roll20.net?src=https%3A//raw.githubusercontent.com/Roll20/roll20-character-sheets/master/ADnD_1E/images/logo.png">


November 01 (3 years ago)
GiGs
Pro
Sheet Author
API Scripter

I believe they do that to make sure any links embedded in character sheets are safe, and arent running any kind of malware on your character sheets. Running it through some kind of validation server makes sure it is actually an image, and not somethign else made to appear to be an image.

For a site like roll20, it's important to validate anything that comes from external servers.

November 02 (3 years ago)
Peter B.
Plus
Sheet Author

vÍnce said:

Peter B. said:

On the sheet that I maintain, the logo image url looks like this: https://imgsrv.roll20.net/?src=https://i.stack.imgur.com/CN5gs.png

Is the prefix https://imgsrv.roll20.net/?src= still needed or is it a very old deprecated thing?

I simply link to the image on the repo in the sheet code

but you'll notice(using the browser's dev tools) that roll20 will convert the link regardless. Not sure why... Perhaps security reasons. IDK
<img src="https://imgsrv.roll20.net?src=https%3A//raw.githubusercontent.com/Roll20/roll20-character-sheets/master/ADnD_1E/images/logo.png">

Thank you Vince. That was exactly what I was looking for.

Now I can confidently move forward with my idea :)


November 02 (3 years ago)

Edited November 02 (3 years ago)
Peter B.
Plus
Sheet Author


vÍnce said:

I simply link to the image on the repo in the sheet code

but you'll notice(using the browser's dev tools) that roll20 will convert the link regardless. Not sure why... Perhaps security reasons. IDK
<img src="https://imgsrv.roll20.net?src=https%3A//raw.githubusercontent.com/Roll20/roll20-character-sheets/master/ADnD_1E/images/logo.png">

Can you help me with linking to an image? if I go to the url: 

Then it works fine. But when I add it to the sheet as an image and run the sheet, it does not load nicely:

https://imgsrv.roll20.net/?src=https%3A//raw.githubusercontent.com/Roll20/roll20-character-sheets/master/AD&D%202E%20Revised/img/sheet-logo.png

I fear the problem is with the special character & and the whitespaces

November 02 (3 years ago)
GiGs
Pro
Sheet Author
API Scripter

There have been problems before with images because of folders with special characters in them. I think you can change the folder name to avoid that.


What url are you using in your character sheet? If you are using this:

https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/AD&D%202E%20Revised/img/sheet-logo.png

Try changing it to

https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/AD&D 2E Revised/img/sheet-logo.png


November 02 (3 years ago)
vÍnce
Pro
Sheet Author

Exactly what GiGs has brought up.  I had to change the 1e sheets folder name on the repo a few years back because it was causing issues linking to git images...
https://github.com/vince-roll20/roll20-character-sheets/commit/440fc770a07c59d41ad083f9216e99b1ba2fca61#diff-3a77ba65768c1268e43d8d305f343babd362aab6b62fd50c626f7974f0469d33


November 02 (3 years ago)
Peter B.
Plus
Sheet Author

GiGs said:

There have been problems before with images because of folders with special characters in them. I think you can change the folder name to avoid that.


What url are you using in your character sheet? If you are using this:

https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/AD&D%202E%20Revised/img/sheet-logo.png

Try changing it to

https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/AD&D 2E Revised/img/sheet-logo.png

I tried both encoded and decoded versions. Neither worked. Guess I have to change the folder name, as suggested by Vince.

I will look into it. I guess it should not break anything right?.... right? :S

November 02 (3 years ago)

Edited November 02 (3 years ago)
vÍnce
Pro
Sheet Author

My comment from my repo folder change might better explain what I discovered at the time.

The & character is replaced by %26 to make a legal url.
But it looks like in this case, the % in %26 has then been replaced again, the code for % is %25, resulting in %2526 where the & should be in that URL.

One caveat that I noticed with changing the folder name is that I believe the history of changes stays with the old folder name. New folder starts a new history of changes moving forward. If you need to go back to work with an older state of the code, I think you also have to work with an older version of the repo. The only time I've needed to worry about that is if I was migrating older attribute data for some reason and needed to create older characters (previous versions of the sheet code) to ensure migration of data was working properly. Just something I noticed.