Skip to main content

Transform

Resize

Image Uploader Pro allows you to resize your images prior to upload keeping the image's aspect ratio. To achieve this, either resizeWidth or resizeHeight has to be set to an integer greater than 0.

Setting both parameters, will lead to image cropping.

Crop

Image Uploader Pro allows you to crop your images prior to upload to fit to a desired size. To achieve this, both resizeWidth and resizeHeight has to be set to an integer greater than 0.

Setting only one parameter, will lead to image resizing.

Compress

Besides resizing, Image Uploader Pro allows you to convert and compress your images prior upload. To achieve this, resizeMimeType and/or resizeQuality can be set in the JSON transformation parameters.

  • resizeMimeType: Conversion to image/jpeg is supported
  • resizeQuality: Compression rate of the image, number between 0 and 1 (1 means no compression)

Transformation Configuration

In order to transform images prior to upload, a JSON configuration string has to be set.

The plug-in supports:

  • Resize keeping aspect ratio: setting at least one resize attribute (resizeWidth or resizeHeight), will lead to image resizing keeping aspect ratio
  • Resize cropping: setting both resize attributes (resizeWidth and resizeHeight) will lead to image cropping to desire size
  • Convert and compress: setting resizeMimeType to "image/jpeg" and resizeQuality to a decimal between 0 and 1, will lead to image conversion to JPEG and compression to desired rate. Renaming function is required if the source image is not in JPEG format. See the Rename section for more information more information.

Watermark

Image Uploader Pro has the capability to embed text into the image prior  to upload and allows you to control the color, size and position of the text.

In order to achieve this, the following parameters need to be set under the watermarking parameters section:

  • font: specifies the text style to use when drawing text. This string uses the same syntax as the CSS font specifier.
  • fontColor: specifies the color, gradient, or pattern to use inside shapes. The default style is #000 (black).
  • positionX: the x-axis coordinate of the point at which to begin drawing the text, in pixels.
  • positionY: the y-axis coordinate of the point at which to begin drawing the text, in pixels.
  • text: the string to be embedded

Rename

Image Uploader Pro allows you to define your own renaming function that will be executed on the client-side, during upload.

In order to rename your files prior to upload, a user defined function can be defined  in the Rename Function field. This function gets the file as an argument and can use the file object.

The actual name of the file that gets used during the upload can be accessed through file.upload.filename.

When converting files to JPEG, a rename function is needed to ensure extension consistency.