Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-8372

if image width or height equals that of the variant default cropping window throws an exception

    XMLWordPrintable

Details

    Description

      When cropping a variant the top-left corner of the cropping window has a small horizontal and vertical offset (like 10px).
      NS ran into the following issue.

      When uploading an image that has the same height and/or width as a variant's resolution, this causes the cropping window to partially lie outside the image. When clicking okay, the CMS doesn't respond, no alert/error is displayed in the UI and an exception is thrown.

      The issue can be reproduced in the gogreen by uploading any of the attached example images and doing a crop for the "Thumbnail (large)" variant. Don't resize or move the box and click ok. Nothing happens.
      When you try to move the box it snaps back to fit inside the image boundaries.

      Stacktrace:
      Caused by: java.awt.image.RasterFormatException: (x + width) is outside of Raster
      at sun.awt.image.ByteInterleavedRaster.createWritableChild(ByteInterleavedRaster.java:1245)
      at java.awt.image.BufferedImage.getSubimage(BufferedImage.java:1203)
      at org.hippoecm.frontend.plugins.gallery.imageutil.ImageUtils.scaleImage(ImageUtils.java:274)
      at org.hippoecm.frontend.plugins.gallery.editor.ImageCropEditorDialog.onOk(ImageCropEditorDialog.java:238)
      at org.hippoecm.frontend.dialog.AbstractDialog.handleSubmit(AbstractDialog.java:519)
      at org.hippoecm.frontend.dialog.AbstractDialog$2.onSubmit(AbstractDialog.java:277)
      at org.hippoecm.frontend.dialog.ButtonWrapper$1.onSubmit(ButtonWrapper.java:80)
      at org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:108)
      at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$1.onSubmit(AjaxFormSubmitBehavior.java:179)
      at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1266)
      at org.hippoecm.frontend.dialog.AbstractDialog.delegateSubmit(AbstractDialog.java:527)
      at org.apache.wicket.markup.html.form.Form.process(Form.java:938)
      at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:770)
      at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:156)
      at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:123)
      at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:626)
      ... 34 more

      Attachments

        1. bug_example_2014-10-16_1005.png
          81 kB
          Owen Knoote
        2. orange hippo 400x330.png
          26 kB
          Owen Knoote
        3. orange hippo 440x300.png
          25 kB
          Owen Knoote

        Issue Links

          Activity

            People

              Unassigned Unassigned
              oknoote Owen Knoote (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: