auto resize + keep ratio

30 views
Skip to first unread message

matias.almada

unread,
Jan 3, 2008, 4:51:41 PM1/3/08
to TiddlyWiki
Hello again

Is there any way of auto resizing videos and images to the max keeping
the original ratio?

Many thanks

Eric Shulman

unread,
Jan 3, 2008, 5:17:47 PM1/3/08
to TiddlyWiki
> Is there any way of auto resizing videos and images to the max keeping
> the original ratio?

Although some embedded players provide parameters to control
"proportional resizing", the basic functionality is provided by the
embedded video player itself, not the page in which it is embedded.

In addition, it depends upon the type of videos being viewed, as well
as how the particular video stream has been encoded. For example:
QuickTime movies can be encoded to maintain proportionality OR stretch-
to-fit, regardless of dimensions.

Finally, how the video appears in your browser also depends upon the
particular browser/OS combination you are using, and which version of
the embedded player plugin is installed in that browser. For example:
when I upgraded WindowsMediaPlayer recently, videos that were
displayed with proportional sizing in the past are now getting
stretched to fit.... and all I did was update the media player.

"... sometimes it *IS* rocket science... " :-)

Good luck...

-e
Eric Shulman
TiddlyTools / ELS Design Studios

Eric Shulman

unread,
Jan 3, 2008, 5:27:24 PM1/3/08
to TiddlyWiki
> Is there any way of auto resizing videos and images to the max keeping
> the original ratio?

For "still images" (gif/jpg/png files), in [[StyleSheet]], define:
.stretch img { width:100%; }

Then, in tiddler content, use:
{{stretch{[img[path/file.jpg]]}}}

The image will be enlarged (or reduced) to always fit the width of the
containing tiddler.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

P.S. The 'stretch' formatting "convenience" CSS class and many others
are available in a pre-defined tiddler from:
http://www.TiddlyTools.com/#StyleSheetShortcuts
Reply all
Reply to author
Forward
0 new messages