Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Currently the ImageHelper class we're using to process user-uploaded images offers several post processing options, like:

  • resizing to given dimensions
  • cropping, with piece to crop take from user-specified location (e.g. center, one of a corners, absolute margins)
  • filling in black bars added during cropping with any color
  • watermarking

However there is always a place for improvements. I'm proposing to add following options:

Option NamePossible ValuesWhat it does
orientation
  • manual (default)
  • auto

Right now attempt to resize 768x1024 (portrait) image to the 1024x768 (landscape) size would result in too small image. This behavior is kept with "manual" option.

However when you specify "auto" option, then given resize dimensions are inverted (only when needed) to match portrait/landscape setting of user uploaded image.

output_format
  • jpg
  • png
  • gif
Right now the format of user uploaded image is preserved after resize. This option would allow to force resized image to have given format.
quality
  • 0-100 - for jpg
  • 0-9 for png

Right now we're setting maximal quality (based on image format) to reduce distortion in resized images.

With this new setting (in combination with "output_format") it will be possible to have images of desired quality.

Examples

  • <inp2:u_Field name="PrimaryImage" format="resize:800x600;orientation:auto"/> - will adjust resize dimensions based on source image orientation
  • <inp2:u_Field name="PrimaryImage" format="resize:800x600;output_format:jpg"/> - will convert image to jpg preserving maximal image quality
  • <inp2:u_Field name="PrimaryImage" format="resize:800x600;output_format:jpg;quality:70"/> - will convert image to jpg with 70% image quality (default setting in Photoshop when saving jpg files)
  • <inp2:u_Field name="PrimaryImage" format="resize:800x600;quality:70"/> - will convert image, but will apply 70 number as-is to the quality parameter, which will result in broken png image (when png is uploaded)

Related Discussions

Related Tasks

INP-1668 - Getting issue details... STATUS

  • No labels