How to open images

79 views
Skip to first unread message

Mathieu Langlois

unread,
Apr 4, 2020, 11:34:36 AM4/4/20
to tiddl...@googlegroups.com
HI, I've been inserting images in my tiddlers with this syntax, [img[images/pictures.jpg]] which works fine and my pictures are fitting nicely.  But sometimes, they are too small to read text on there and I would like to be able to click on them and have them open full size in a different window or in an image viewer.  Is there a way to do that or do I need some plugin.  I search online and found some things about tm-modal, but never found a clear answer.  I'm using desktop version by the way.

Mat

unread,
Apr 4, 2020, 11:39:25 AM4/4/20
to TiddlyWiki
see https://tiddlywiki.com/prerelease/#Images%20in%20WikiText

and how to set size or add class

<:-)

Mathieu Langlois

unread,
Apr 4, 2020, 11:52:07 AM4/4/20
to TiddlyWiki
Thanks for the answer, but the width and height only allow me to reduce the size, but the scaling up is limited to the tiddler size.  Which is why I wanted to open a new window with the image full size in it.

Mat

unread,
Apr 4, 2020, 11:56:05 AM4/4/20
to TiddlyWiki
Did you try to create a css class for it? For example this seems to work;

[img class="myclass" [Motovun Jack.jpg]]

<style>
.myclass {width:100%;}
</style>


<:-)

Mathieu Langlois

unread,
Apr 4, 2020, 12:17:31 PM4/4/20
to tiddl...@googlegroups.com

Ok, I tried it, here's a printscreen of what I get.  On the left, the image is to 100% of the Tiddler, but on the right, this is the image at 100% I manually opened in an image viewer.  



Test.jpg

Ton Gerner

unread,
Apr 4, 2020, 12:18:20 PM4/4/20
to TiddlyWiki
Hi Mathieu,

Create a macro: a tiddler tagged with $:/tags/Macro containing:

\define image(source)
<a href="images/$source$" title="Click for a bigger version (opens in a separate tab)" target="_blank">
     
<img src="images/$source$"/>
</a>
\end

And use it as follows:

<<image "image.ext">>

Cheers,

Ton


Mathieu Langlois

unread,
Apr 4, 2020, 12:24:38 PM4/4/20
to TiddlyWiki
Yes! It does exactly what I wanted!  Thank you!  Thank you Mat too for the help!   :)
Reply all
Reply to author
Forward
0 new messages