Home Features Demos Download Installation User Manual Developer Manual Relation function Credits

Anmelden

inc/image.php

Handles image downscaling if $swImageScaler is set true in configuration.php. If not, the the image0.php code is used.

Functions

swImageDownscale($name, $destw, $desth=0)

Downscale is actually invoked when the images.php parser creates the image link. To reduce bandwidth, we create downscaled versions of the image and save them to the cache folder. The link then refers directly to the cache folder.

You can specify a width and optionally a height.

The function deals with JPEG, PNG and GIF files and handles also PNG files that are named as JPEG files. It cannot handle PDF files.

The name of the cache file has the syntax WIDTH-HEIGHT-NAME. If the file exists, it is returned, if not, it is created. If the width is bigger than the width of the actual file, it is upscaled not more than to 150%. The function returns the path if the file could be created.

swBlackLine($im, $line, $vertical = true)

Identifies if a vertical or horizontal line in an image is black (all pixels lower than #040404).

swCropBlack($img)

Returns a new cropped image without black borders.

swBlackLine($im, $line, $vertical = true)

Not used
Calculates energy in a line as maximum of the standard error of the colors of the pixels of each third of the segment of the line, as a measure of detail.

swSquareEnergy($im, $x0, $y0)

Calculates energy of a 16x16 square as the standard error of the colors of the pixels.

swAutoCropResize($img0, $destw, $desth)

Not used'
Crops images and resizes it by choosing the region of interest based on a 144x144 version of the image and the line energy of each line of it.

swAutoCropResize2($img0, $destw, $desth)

Crops images and resizes it by choosing the region of interest based on a 144x144 version of the image and the energy of each 16x16 square in it.

File structure inc folder