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

Share Image macro

1571718982
Mike deBoston
Compendium Curator
Okay, this is so easy it's almost nothing, but maybe your players don't know this trick. Now they can share images in chat with a simple UI. Macro name: share-image [picture](?{URL}) Yeah, that's all. I saw Keith mention it in a forum post but thought it'd be slightly easier if it was a button.
Would be great if you could show image similar to Shift+Z on token (dark overlay and image in the center). Some images are too small in the chat :(
1571850593
Mike deBoston
Compendium Curator
Yeah. I wish there was a way to zoom in on NPC tokens when the player does not have control over the token, or to view the Avatar art if the token is linked to a character sheet. I have to upload the Avatar art into the game AND store it offsite with a URL to it, then write a macro for it... And if the char sheet doesn't have the field you get an ugly error message. I swear Roll20 hates art.
1571851946
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You can get the URL of the art by pressing shift-z, right-clicking on the preview and opening in a new tab or just copying the URL. Then you can display it as you would an offsite graphic. Just get rid of all the code that appears after the question mark. <a href="https://s3.amazonaws.com/files.d20.io/images/24664073/GYSSrE716N5AjMxHejQd8w/original.png?14776360325" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/24664073/GYSSrE716N5AjMxHejQd8w/original.png?14776360325</a> becomes <a href="https://s3.amazonaws.com/files.d20.io/images/24664073/GYSSrE716N5AjMxHejQd8w/original.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/24664073/GYSSrE716N5AjMxHejQd8w/original.png</a>
1571858224

Edited 1571858285
Mike deBoston
Compendium Curator
That's a great tip! It should go in the thing! And it appears you don't need to get rid of the part of the URL after the question mark. Both give the same result as far as I can tell.
1571860150
Mike deBoston
Compendium Curator
And players can't shift-z on tokens they don't control. I wish the Avatar URL was available to macros, instead of having to copy it into a sheet attribute.
1571861640

Edited 1571861717
Phenomen
Translator
@keithcurtis posted that script (require Pro) on Discord few days ago: There's also Char-pic, which displays the image from a character sheet bio in chat: on('ready', function() { &nbsp; &nbsp; on('chat:message', function(msg) { &nbsp; &nbsp; &nbsp; &nbsp;if (msg.type == "api" &amp;&amp; msg.content.indexOf("!char-pic") !== -1) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var charid =msg.content.split(' ')[1]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var c = getObj('character',charid); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(c) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var fPart = "&lt;div style='box-shadow: 3px 3px 2px #888888; font-family: Verdana; text-shadow: 2px 2px #000; text-align: center; vertical-align: middle; padding: 1px 1px; margin-top: 0.1em; border: 1px solid #000; border-radius: 8px 8px 8px 8px; color: #FFFFFF;"; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var Pic = fPart + "background-color:#AAAAAA;'&gt;&lt;img src='" + c.get('avatar') + "'&gt;&lt;/div&gt;"; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sendChat('', "/direct " + Pic); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp;}; &nbsp; &nbsp; }); }); Run that one with the macro !char-pic @{selected|character_id}
1571865637
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Mike deBoston said: That's a great tip! It should go in the thing! And it appears you don't need to get rid of the part of the URL after the question mark. Both give the same result as far as I can tell. Must be some fiddly thing going on behind the scenes then, it makes or breaks it for me. And I think that it is in the thing, though mentioned in several Stupid Tricks rather than on its own.
1571896142
Mike deBoston
Compendium Curator
It might be that the URL ending with "original.png?14776360325" works, but you need to append "#.jpg" or "#.png" to it so that Roll20 will recognize it as an image. It doesn't matter which suffix.