docs.roxen.comBack to normal mode
DocsRoxenWebServer 5.0Web Developer ManualGraphics Tags
Copyright © 2012, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com

<cimg-url/>

Provided by module: Graphics: Image converter

This tag generates an URL to the manipulated picture. <cimg-url> takes the same attributes as <cimg>, including the image cache attributes. The use for the tag is to insert image-URLs into various places, e.g. a submit-box.


Attributes

src="url"

The path to the indata file.

<cimg-url src='/internal-roxen-testimage'/>
/_internal/cimg!0/d0hu9i0wpdc97chmslse4fkmtzc3enl

data="imagedata"

Insert images from other sources, e.g. databases through entities or variables.

<emit source='sql' query='select imagedata from images where id=37'> <cimg-url data='&sql.imagedata;'/> </emit>

Timeout

The generated image will by default never expire, but in some circumstances it may be pertinent to limit the time the image and its associated data is kept. Its possible to set an (advisory) timeout on the image data using the following attributes.

unix-time="number"

Set the base expiry time to this absolute time.

If left out, the other attributes are relative to current time.


years="number"

Add this number of years to the time this entry is valid.


months="number"

Add this number of months to the time this entry is valid.


weeks="number"

Add this number of weeks to the time this entry is valid.


days="number"

Add this number of days to the time this entry is valid.


hours="number"

Add this number of hours to the time this entry is valid.


beats="number"

Add this number of beats to the time this entry is valid.


minutes="number"

Add this number of minutes to the time this entry is valid.


seconds="number"

Add this number of seconds to the time this entry is valid.


format="{gif, jpeg, png, avs, gmp, bd, hrz, ilbm, psx, pnm, ps, pvr, tga, tiff, wbf, xbm, xpm}" (gif)

The format to encode the image to. The formats available are:

AcronymAcronym interpretation

gif

Graphics Interchange Format (might be missing in your roxen)

jpeg

Joint Photography Expert Group image compression

png

Portable Networks Graphics

avs

Advanced Visual Systems Inc. image format

bmp

Windows BitMaP file

gd

Internal format used by libgd

hrz

HRZ is (was?) used for amatuer radio slow-scan TV.

ilbm

Interchangeable File Format: interleaved bitmap

pcx

Zsoft PCX file format (PC / DOS)

pnm

Portable AnyMap

ps

Adobe PostScript file

pvr

Pover VR (dreamcast image)

tga

TrueVision Targa (PC / DOS)

tiff

Tag Image File Format

wbf

WAP Bitmap File

xbm

XWindows Bitmap File

xpm

XWindows Pixmap File

<cimg-url src='/internal-roxen-testimage' format='png'/>
/_internal/cimg!0/d0hu9i0wpdc97chmslse4fkmtzc3enl
<cimg-url src='/internal-roxen-testimage' format='gif'/>
/_internal/cimg!0/qpbe4834m7q16uwrhax3nncuxr5vunn

quant="number" (format dependant)

The number of colors to quantizize the image to.

Default for gif is 32(+1 transparent), for most other formats (except black and white) is it unlimited.

<cimg-url src='/internal-roxen-testimage' quant='2'/>
/_internal/cimg!0/rrqmp597wxybrxi7w44vpqgo6x8nxwc

dither="{none, random, floyd-steinberg}" (none)

Choose the dithering method.

MethodMeaning

none

No dithering is performed at all.

random

Random scatter dither. Not visually pleasing, but it is useful for very high resolution printing.

floyd-steinberg

Error diffusion dithering. Usually the best dithering method.

<cimg-url src='/internal-roxen-testimage' dither='random' quant='10'/>
/_internal/cimg!0/lm6i4ui28h58hwx4jb5pnqx4bgtx8tz
<cimg-url src='/internal-roxen-testimage' dither='floyd-steinberg' quant='10'/>
/_internal/cimg!0/8lw7dey1744mwaxeptwm1be635ze2w0

true-alpha

If present, render a real alpha channel instead of on/off alpha. If the file format only supports on/off alpha, the alpha channel is dithered using a floyd-steinberg dither.

<cimg-url src='/internal-roxen-testimage' opaque-value='20'/>
/_internal/cimg!0/105wvm9o2nlxbq7og6e8j2ajf63kmjs
<cimg-url src='/internal-roxen-testimage' opaque-value='20' true-alpha='1'/>
/_internal/cimg!0/hemahndnt9ajlohj8ms2si06ijzjzjh

background-color="color" (taken from the page)

The color to render the image against.

<cimg-url src='/internal-roxen-testimage' background-color='red' opaque-value='50'/>
/_internal/cimg!0/4v1xv8djdbh6ngrhn5one078u1qiw66

opaque-value="percentage" (100)

The transparency value to use, 100 is fully opaque, and 0 is fully transparent.


cs-rgb-hsv="{0, 1}" (0)

Perform rgb to hsv colorspace conversion.

<cimg-url src='/internal-roxen-testimage' cs-rgb-hsv='1'/>
/_internal/cimg!0/da5ye8h91misfd0d1abdx4m89tfgsgw

gamma="number" (1.0)

Perform gamma adjustment.

<cimg-url src='/internal-roxen-testimage' gamma='0.5'/>
/_internal/cimg!0/81kroex02z85c8x630k2r5th8irer32
<cimg-url src='/internal-roxen-testimage' gamma='1.5'/>
/_internal/cimg!0/d2lyinwj7crp6ue5qjzfydyp1m3pyhs

cs-grey="{0, 1}" (0)

Perform rgb to greyscale colorspace conversion.

<cimg-url src='/internal-roxen-testimage' cs-grey='1'/>
/_internal/cimg!0/2ipwytd4jbolbbctwpsax5n6muxgsix

cs-invert="{0, 1}" (0)

Invert all colors

<cimg-url src='/internal-roxen-testimage' cs-invert='1'/>
/_internal/cimg!0/8ip6is8mqh43gt3hrvof6rrrydxp0j7

cs-hsv-rgb="{0, 1}" (0)

Perform hsv to rgb colorspace conversion.

<cimg-url src='/internal-roxen-testimage' cs-hsv-rgb='1'/>
/_internal/cimg!0/c3iyj9t1wlnmjj5gpb3evg41lxzwmes

rotate-cw="degree" (0)

Rotate the image clock-wise.

<cimg-url src='/internal-roxen-testimage' rotate-cw='20'/>
/_internal/cimg!0/axb141iz2shqd4ty37sn6mxzjs96jk1

rotate-ccw="degree" (0)

Rotate the image counter clock-wise.


rotate-unit="{rad, deg, ndeg, part}" (deg)

Select the unit to use while rotating.

UnitMeaning

rad

Radians

deg

Degrees

ndeg

'New' degrees (400 for each full rotation)

part

0 - 1.0 (1.0 == full rotation)


mirror-x="{0, 1}" (0)

Mirror the image around the X-axis.


mirror-y="{0, 1}" (0)

Mirror the image around the Y-axis.


scale="fact" (1.0)

Scale fact times. (0.5 -> half size, 2.0 -> double size)

<cimg-url src='/internal-roxen-testimage' scale='0.5'/>
/_internal/cimg!0/6bs3ie4ictyflzv6pkqke08707ow4zd

scale="x,y"

Scale to the exact size x,y. If either of X or Y is zero, the image is scaled to the specified width or hight, and the value that is zero is scaled in proportion to the other value.

<cimg-url src='/internal-roxen-testimage' scale='20,50'/>
/_internal/cimg!0/ljvy15ieqm4wn06mnv9b2ualcelze4n

max-width="xsize"

If width is larger than 'xsize', scale width to 'xsize' while keeping aspect.


max-height="ysize"

If height is larger than 'ysize', scale height to 'ysize' while keeping aspect.


span-width="xsize"

If width is larger than 'xsize', scale width to 'xsize' while keeping aspect. If width is smaller than 'xsize', extend width to 'xsize' by filling the new space with current background color.

<cimg-url src='/internal-roxen-testimage' span-width="350" background-color='white'/>
/_internal/cimg!0/njip3xqqyf85mkrvg5y8opgv2g4qz7

span-height="ysize"

If height is larger than 'ysize', scale height to 'ysize' while keeping aspect. If height is smaller than 'ysize', extend height to 'ysize' by filling the new space with current background color.

<cimg-url src='/internal-roxen-testimage' span-height="350" background-color='white'/>
/_internal/cimg!0/b020huhb052cxecsmyt6kame0y2e4bn

x-offset="pixels" (0)

Cut n pixels from the beginning of the X scale.

<cimg-url src='/internal-roxen-testimage' x-offset='100'/>
/_internal/cimg!0/npogahhee67occrbrhoku5lqrt6bsuu

y-offset="pixels" (0)

Cut n pixels from the beginning of the Y scale.


x-size="pixels" (whole image)

Keep n pixels from the beginning of the X scale.

<cimg-url src='/internal-roxen-testimage' x-size='100'/>
/_internal/cimg!0/qdyvr74nznw3bmcpsvq7sxtrwa5ls0f

y-size="pixels" (whole image)

Keep n pixels from the beginning of the Y scale.


crop="{x1,y1-x2,y2, auto, guides-cross, guides-region}"

Crops the image by using several differen methods. The simplest is to only specify the area to be cropped with x,y-x,y coordinates. By instead selecting "auto" the image will be cropped so that as many pixels as possible with the same color is removed from around the image.

A more advanced cropping method can be used by giving the crop argument "guides-cross". The image will then be cropped around the intersection of two guides inside the image. Guides can be added to e.g. Photoshop and GIMP images. If several guides are present, which ones to use can be selected with the guides-index=x,y attribute, where x and y is the number of the guides. Guides cross cropping is usefull together with max-width and max-height attributes when creating thumb nails.

A combination of guides cross cropping can be used by giving the crop argument "guides-region". In this cropping mode the area enclosed by two horizontal and two vertical guides are saved. Which guides to use is given by the guides-index=x1,y1-x2,y2 attribute, where the x and y parameters are the number of the guides. Guides can also be specified as guides-index=x,y. Then the saved area will be the one enclosed by the buides x,y and x+1,y+1, counting from left and top. Again, combine max-width and max-height makes a good effect, since scaling is performed after cropping.

<cimg-url src='/internal-roxen-testimage' crop='50,28-150,92'/>
/_internal/cimg!0/13gjawhl4kmitp778tee50sajjnhul3

jpeg-quality="percentage" (75)

Set the quality on the output jpeg image.

<cimg-url src='/internal-roxen-testimage' format='jpeg' jpeg-quality='30'/>
/_internal/cimg!0/mf022apadbn0jpp6nu8vx90e3ot4d6n
<cimg-url src='/internal-roxen-testimage' format='jpeg' jpeg-quality='1'/>
/_internal/cimg!0/6yldrz8lui5jb3ci9jvt0s2fivenz1e

jpeg-optimize="{0, 1}" (1)

If 0, do not generate optimal tables. Somewhat faster, but produces bigger files.


jpeg-progressive=="{0, 1}" (0)

Generate progressive jpeg images.


jpeg-smooth="0-100" (0)

Smooth the image while compressing it. This produces smaller files, but might undo the effects of dithering.


bmp-bpp="1,4,8,24" (24)

Force this number of bits per pixel for bmp images.


bmp-windows="{0, 1}" (1)

Windows or OS/2 mode, default is 1. (windows mode)


bmp-rle="{0, 1}" (0)

RLE 'compress' the BMP image.


gd-alpha_index="color" (0)

Color in the colormap to make transparent for GD-images with alpha channel.


pcx-raw="{1, 0}" (0)

If 1, do not RLE encode the PCX image.


pcx-dpy="0-10000000.0" (75.0)

Resolution, in pixels per inch.


pcx-xdpy="0-10000000.0" (75.0)

Resolution, in pixels per inch.


pcx-ydpy="0-10000000.0" (75.0)

Resolution, in pixels per inch.


pcx-xoffset="0-imagexsize-2" (0)

Offset from start of image data to image content for PCX images. Unused by most programs.


pcx-yoffset="0-imageysize-2" (0)

Offset from start of image data to image content for PCX images. Unused by most programs.


tga-raw="{1, 0}" (0)

If 1, do not RLE encode the Targa image.


ps-dpi="0-10000000.0" (75.0)

Dots per inch for the resulting postscript file.