Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-20

Add crop ability to ImageHelper class

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0
    • Component/s: Front End
    • Labels:
      None

      Description

      Add ability to crop image during resizing.

      Invocation syntax:
      <inp2:sample-prefix_Field name="ImageField" format="resize:100x200;crop:c|c"/>

      Invocation syntax for catalog item/category images:
      <inp2:prefix_Image render_as="article_image" thumbnail="1" DefaultImage="img/no_article_image.gif" Crop="c|c" MaxWidth="143" MaxHeight="124" DefaultWidth="143" />
      <inp2:prefix_Image render_as="article_image" thumbnail="1" DefaultImage="img/no_article_image.gif" Crop="1" MaxWidth="143" MaxHeight="124" DefaultWidth="143" />

      Description:
      Resize image (keeping proportions) to maximal possible size based on given (width - 100, height - 200), then crop rectangle area of given size (width - 100, height - 200) from center of resized image.

      Crop format part accepts 2 arguments separated by "|": "crop:<x_position>|<y_position>". Positive value is crop offset from left/top. Negative value is crop offset from right/bottom. "C"/"c" is centered horizontally or vertically.

        Attachments

          Activity

            People

            • Assignee:
              alex Alex
              Reporter:
              alex Alex
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: