SmartSprites
  1. SmartSprites
  2. SMARTSPRITES-53

ArrayIndexOutOfBoundsException when an illegal sprite-alignment value is specified

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.2.4, 0.2.5
    • Fix Version/s: 0.2.6
    • Labels:
      None

      Description

      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
             at sun.awt.image.ByteInterleavedRaster.setDataElements (ByteInterleavedRaster.java:546)
             at java.awt.image.BufferedImage.setRGB(BufferedImage.java: 1031)
             at org.carrot2.util.BufferedImageUtils.drawImage (BufferedImageUtils.java:187)
             at org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render (SpriteReferenceOccurrence.java:89) 
      	   at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImage (SpriteImageBuilder.java:279)
             at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteReplacements (SpriteImageBuilder.java:125)
             at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImages (SpriteImageBuilder.java:62)
             at org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites (SpriteBuilder.java:176)
             at org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites (SpriteBuilder.java:121)
             at org.carrot2.labs.smartsprites.SmartSprites.main (SmartSprites.java:46)
      

        Activity

        Hide
        František Jahoda; added a comment -

        The files from attachment produce following exception.

        Thank you for an early fix or a hint how to workaround it.

        (i also cannot add an attachment with bug producing files because following error in carrot2: * Exception trying to establish attachment directory. Check that the application server and JIRA have permissions to write to it: com.atlassian.jira.web.util.AttachmentException: Cannot write to attachment directory. Check that the application server and JIRA have permissions to write to: /home/jira/jira4-attachments/SMARTSPRITES/SMARTSPRITES-53

        • No files were attached. Please add your attachments again (lost during reload).
          ) Write me to jahodfra at seznam dot cz and I will send it to you trough email.

        C:\workspace\smartsprites>smartsprites.cmd --root-dir-path C:\workspace\efractal
        \WebSite\Root\Skin\INFO: Reading sprite image directives from C:\workspace\efractal\WebSite\Root\Sk
        in\smartsprite-sprite.css
        INFO: Reading sprite image directives from C:\workspace\efractal\WebSite\Root\Sk
        in\smartsprite.css
        INFO: Reading sprite reference directives from C:\workspace\efractal\WebSite\Roo
        t\Skin\smartsprite-sprite.css
        INFO: Reading sprite reference directives from C:\workspace\efractal\WebSite\Roo
        t\Skin\smartsprite.css
        INFO: Reading image from C:\workspace\efractal\WebSite\Root\Skin\Images\page-top
        -bg.png (C:\workspace\efractal\WebSite\Root\Skin\smartsprite.css, line: 6)
        INFO: Reading image from C:\workspace\efractal\WebSite\Root\Skin\Images\sidebox-
        bg.png (C:\workspace\efractal\WebSite\Root\Skin\smartsprite.css, line: 11)
        Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Coordinate
        out of bounds!
        at sun.awt.image.ByteInterleavedRaster.setDataElements(Unknown Source)
        at java.awt.image.BufferedImage.setRGB(Unknown Source)
        at org.carrot2.util.BufferedImageUtils.drawImage(BufferedImageUtils.java
        :187)
        at org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render(Sprite
        ReferenceOccurrence.java:104)
        at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImage(Spr
        iteImageBuilder.java:279)
        at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteReplaceme
        nts(SpriteImageBuilder.java:125)
        at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImages(Sp
        riteImageBuilder.java:62)
        at org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites(SpriteBuilde
        r.java:176)
        at org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites(SpriteBuilde
        r.java:121)
        at org.carrot2.labs.smartsprites.SmartSprites.main(SmartSprites.java:46)

        Show
        František Jahoda; added a comment - The files from attachment produce following exception. Thank you for an early fix or a hint how to workaround it. (i also cannot add an attachment with bug producing files because following error in carrot2: * Exception trying to establish attachment directory. Check that the application server and JIRA have permissions to write to it: com.atlassian.jira.web.util.AttachmentException: Cannot write to attachment directory. Check that the application server and JIRA have permissions to write to: /home/jira/jira4-attachments/SMARTSPRITES/ SMARTSPRITES-53 No files were attached. Please add your attachments again (lost during reload). ) Write me to jahodfra at seznam dot cz and I will send it to you trough email. C:\workspace\smartsprites>smartsprites.cmd --root-dir-path C:\workspace\efractal \WebSite\Root\Skin\INFO: Reading sprite image directives from C:\workspace\efractal\WebSite\Root\Sk in\smartsprite-sprite.css INFO: Reading sprite image directives from C:\workspace\efractal\WebSite\Root\Sk in\smartsprite.css INFO: Reading sprite reference directives from C:\workspace\efractal\WebSite\Roo t\Skin\smartsprite-sprite.css INFO: Reading sprite reference directives from C:\workspace\efractal\WebSite\Roo t\Skin\smartsprite.css INFO: Reading image from C:\workspace\efractal\WebSite\Root\Skin\Images\page-top -bg.png (C:\workspace\efractal\WebSite\Root\Skin\smartsprite.css, line: 6) INFO: Reading image from C:\workspace\efractal\WebSite\Root\Skin\Images\sidebox- bg.png (C:\workspace\efractal\WebSite\Root\Skin\smartsprite.css, line: 11) Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds! at sun.awt.image.ByteInterleavedRaster.setDataElements(Unknown Source) at java.awt.image.BufferedImage.setRGB(Unknown Source) at org.carrot2.util.BufferedImageUtils.drawImage(BufferedImageUtils.java :187) at org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render(Sprite ReferenceOccurrence.java:104) at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImage(Spr iteImageBuilder.java:279) at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteReplaceme nts(SpriteImageBuilder.java:125) at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImages(Sp riteImageBuilder.java:62) at org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites(SpriteBuilde r.java:176) at org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites(SpriteBuilde r.java:121) at org.carrot2.labs.smartsprites.SmartSprites.main(SmartSprites.java:46)
        Hide
        František Jahoda; added a comment -

        I forgot to add that this happens in smartsprites 0.2.5 and also in smartsprites 0.3.0-dev

        Show
        František Jahoda; added a comment - I forgot to add that this happens in smartsprites 0.2.5 and also in smartsprites 0.3.0-dev
        Hide
        Stanisław Osiński added a comment -

        Attachments should work now.

        Show
        Stanisław Osiński added a comment - Attachments should work now.
        Hide
        Stanisław Osiński added a comment -

        Hi František, attachments should work now. Can you try attaching your files once again?

        Show
        Stanisław Osiński added a comment - Hi František, attachments should work now. Can you try attaching your files once again?
        Hide
        Stanisław Osiński added a comment -

        Attachment from František.

        Show
        Stanisław Osiński added a comment - Attachment from František.
        Hide
        Stanisław Osiński added a comment -

        This issue was caused by a bug in the procedure checking the allowed values of sprite-alignment. In František's example, an individual image with sprite-align: bottom was to be added to a vertical sprite. For vertical sprites only left and right alignments make sense, but SmartSprites failed to verify that.

        Show
        Stanisław Osiński added a comment - This issue was caused by a bug in the procedure checking the allowed values of sprite-alignment . In František's example, an individual image with sprite-align: bottom was to be added to a vertical sprite. For vertical sprites only left and right alignments make sense, but SmartSprites failed to verify that.

          People

          • Assignee:
            Stanisław Osiński
            Reporter:
            Stanisław Osiński
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0h
              0h
              Logged:
              Time Spent - 2h 50m
              2h 50m

                Development