SmartSprites

ArrayIndexOutOfBoundsException when an illegal sprite-alignment value is specified

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 0.2.4, 0.2.5
  • Fix Version/s: 0.2.6
  • Component/s: None
  • Description:
    Hide
    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)
    Show
    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)
  1. bug-report.zip
    (7 kB)
    Stanisław Osiński
    10/Dec/09 10:21 PM

Activity

Hide
František Jahoda; added a comment - 09/Dec/09 05:31 PM

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 - 09/Dec/09 05:31 PM 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 - 09/Dec/09 05:34 PM

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 - 09/Dec/09 05:34 PM 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 - 09/Dec/09 05:57 PM

Attachments should work now.

Show
Stanisław Osiński added a comment - 09/Dec/09 05:57 PM Attachments should work now.
Hide
Stanisław Osiński added a comment - 09/Dec/09 05:58 PM

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

Show
Stanisław Osiński added a comment - 09/Dec/09 05:58 PM Hi František, attachments should work now. Can you try attaching your files once again?
Hide
Stanisław Osiński added a comment - 10/Dec/09 10:21 PM

Attachment from František.

Show
Stanisław Osiński added a comment - 10/Dec/09 10:21 PM Attachment from František.
Hide
Stanisław Osiński added a comment - 12/Dec/09 09:32 PM

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 - 12/Dec/09 09:32 PM 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

Dates

  • Created:
    18/Sep/09 08:30 AM
    Updated:
    12/Dec/09 09:53 PM
    Resolved:
    12/Dec/09 09:32 PM

Time Tracking

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