27.8.3.2.3 Providing scaled thumbnails

When you use scaled thumbnails, the name of each thumbnail is the same as the name of the full-size graphic. To provide thumbnails scaled by the browser at run time from your original graphics, specify the following option:

[Graphics]
ExtrGraphThumbnail=Scaled

When ExtrGraphThumbnail=Scaled, DITA2Go uses the original image, applying scaling factors that you can specify:

[Graphics]
; ExtrGraphHigh = size in pixels for height of thumbnail
;  display of graphic when ExtrGraphThumbnail=Scaled
;  default 96 pixels (one inch)
ExtrGraphHigh=96
; ExtrGraphWide = size in pixels for width of thumbnail
;  display of graphic when ExtrGraphThumbnail=Scaled
;  default 96 pixels (one inch)
ExtrGraphWide=96
; ExtrGraphClass = name of CSS class to use in predefined
;  <$_extrthumb> macro
;ExtrGraphClass=thumbnail
; ExtrGraphTarget = target attribute for window used by <$_extrthumb>
ExtrGraphTarget=_blank

For the thumbnail, ExtrGraph* settings override any [Graph*] settings for width and height values. The ExtrGraph* settings do not conflict with (for example) a user-defined <$ExtrGraphHigh> macro, nor with predefined macro variable <$$_extrgraphhigh> or <$$_extrgraphwide>; all are in different DITA2Go internal namespaces.

Preserve aspect ratio

If you want to use a reduced size for thumbnails, but not all images have the same aspect ratio, set only one of ExtrGraphHigh or ExtrGraphWide to the number of pixels you want, and set the other to 0 (zero).

Predefined macro <$_extrthumb>

For convenience you can use built-in macro <$_extrthumb>, which is defined as follows:

<p class="<$$_extrgraphclass>"><a href="<$$_extrfile>">
 target="<$$_extrgraphtarget>"><img src="<$$_extrgraph>" \
<$_if ($$_extrgraphhigh > 0)> height="<$$_extrgraphhigh>"<$_endif>\
<$_if ($$_extrgraphwide > 0)> width="<$$_extrgraphwide>"<$_endif>\
 alt="<$$_extrtitle>" /></a></p>

Using this macro, the settings you need for scaled thumbnails can be reduced to the following:

[Graphics]
ExtrGraphThumbnail=Scaled

[ExtrReplace]
*=<$_extrthumb>

Previous Topic:  27.8.3.2.2 Providing separate thumbnails

Next Topic:  27.8.3.2.4 Including text with a thumbnail

Parent Topic:  27.8.3.2 Using thumbnails for links to illustrations in HTML

Sibling Topics:

27.8.3.2.1 Choosing a thumbnail method

27.8.3.2.2 Providing separate thumbnails

27.8.3.2.4 Including text with a thumbnail

Table of ContentsIndex