converter.thumbnailSizeLimit Property HTML5/Flash Uploader JavaScript

Supported technologies:

Gets or sets a max file size for a thumbnail generated by uploader.

Syntax

JavaScript Initialize
$au.imageUploaderFlash({
    converters : [
        {
            //...other params...
            thumbnailSizeLimit: 0,
            //...other params...
        }
    ]
})
Get/Set Value at Runtime
$au.imageUploaderFlash('uploaderID').converters().set(index).thumbnailSizeLimit(value);
value = $au.imageUploaderFlash('uploaderID').converters().get(index).thumbnailSizeLimit();

Property Value

Type: Number

A max file size (in bytes) generated by the uploader. If 0 is specified, the uploader does not try to optimize size. It just uses thumbnailJpegQuality without trying to pick an optimal value.

Default value is 0.

Remarks

This property makes sense only if the mode property is Thumbnail and the converter tries to create JPEG (or thumbnailType is auto). It works in the following way:

  1. If the thumbnailType is auto, it tries to create PNG. If this PNG is smaller than the specified limit, a converter returns the PNG file. Otherwise, it tries to create JPEG as explained further.
  2. It tries to create a JPEG file with the max possible quality. If it is too large, it tries smaller value, unless it picks a JPEG quality which produces the desired result.
  3. The minimum possible JPEG quality it tries is the value specified by the thumbnailJpegQuality. If the file size is still too large, the algorithm stops there and uploads the image created with this quality.

It is important to pick realistic values for the combination of the JPEG quality, size limit and thumbnail dimensions.

See Also

Reference

Manual