Scaled image macro

Introduction

The snipscale macro package consists of snipsnap macros to make it easier to create a photo album in snipsnap.

The scaled-image macro will scale one or more images, provides a thumbnail with link and an optional caption.

Examples

Single image

Single image with caption

This is how you do a single image with one caption.

{scaled-image:img=twister1.jpg|thumb=120|size=640|caption=Twister} {scaled-image}

You can choose not to scale the linked image with "original".

{scaled-image:img=twister1.jpg|thumb=120|size=original|caption=Twister} {scaled-image}

You can also refer to an image attachment of another snip with the "snip" attribute.

{scaled-image:img=twister1.jpg|snip=scaled-image-test|thumb=120|size=original|caption=Twister} {scaled-image}

You can upload a zip file with multiple images and use the images in the zip file.

{scaled-image:img=twister1.jpg|thumb=120|size=original|zip=album.zip|caption=Twister} {scaled-image}

Multiple images

Multiple images with one caption

These are multiple images with no caption. You can use the "range" attribute to select multiple attached images.

{scaled-image:range=all|thumb=120|size=original} {scaled-image}

Or, you can use a range with numbers to select images.

{scaled-image:range=1-2|thumb=120|size=original} {scaled-image}

Multiple, comma delimited ranges.

{scaled-image:range=1-2,4-6,10-20|thumb=120|size=original} Multiple images with one caption {scaled-image}

You can upload a zip file with multiple images and display images in the zip file.

{scaled-image:range=1-2,4-6,10-20|zip=album.zip|thumb=120|size=original} Multiple images with one caption {scaled-image}

Use the filename as caption, with caption=auto

{scaled-image:range=all|zip=album.zip|caption=auto} {scaled-image}

Captions

You can add captions to your images. The simplest option is to use the caption parameter of a single image:

{scaled-image:img=twister1.jpg|thumb=120|caption=Twister} {scaled-image}

If the caption is very long, you may put the caption in the body:

{scaled-image:img=twister1.jpg|thumb=120} This is me with my hanglider, enjoying the skies. {scaled-image}

You may want to use the filename as caption, with the "caption=auto" parameter.

{scaled-image:zip=album.zip|caption=auto} {scaled-image}

If you have a large collection of images and you want to specify captions for each image in the collection, you may use this pattern in the body:

{scaled-image:zip=album.zip|caption=auto} image1.jpg:Twister image2.jpg:This is me in the sky. {scaled-image}

Opening images in separate window

To display images in a new window, you can add the 'target' parameter. If this is set, a target attribute will be added to the link. Example:

{scaled-image:img=twister1.jpg|target=myimages|thumb=120|size=640} Twister {scaled-image}

Making an album

To display multiple images with their own caption, also use these macro's:

  • image-container - Groups images into a div section.
  • scaled-image-settings - Sets common attributes for following scaled-image macro's, saves you some typing.

Macro scaled-image

Attributes

  • img - filename of the image attachment or file contained in zip file.
  • thumb - integer as the maximum size of the thumbnail, the string "original" to indicate no scaling
  • size - integer as the maximum size of the thumbnail, the string "original" to indicate no scaling, the string "nolink" to indicate that no link to image should be created.
  • alt - alt text of the image
  • float - the side where to float the image: "right" or "left"
  • zip - filename of zip file attachment.
  • snip - name of snip that contains the attachment of the image file or zip file.
  • range - the string "all" for all images in zip file, comma delimited integers or integers with from-to.
  • target - the name of the window target to be used in the link
  • caption - if this is "auto", it will display filenames as caption, if no caption is given in the body, otherwise this string will be used as caption.