Issue Details (XML | Word | Printable)

Key: SMARTSPRITES-53
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Stanisław Osiński
Reporter: Stanisław Osiński
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
SmartSprites

ArrayIndexOutOfBoundsException when an illegal sprite-alignment value is specified

Created: 18/Sep/09 08:30 AM   Updated: 12/Dec/09 09:53 PM   Resolved: 12/Dec/09 09:32 PM
Component/s: None
Affects Version/s: 0.2.4, 0.2.5
Fix Version/s: 0.2.6

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

File Attachments: 1. Zip Archive bug-report.zip (7 kB)



 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)


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)


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


Stanisław Osiński added a comment - 09/Dec/09 05:57 PM

Attachments should work now.


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?


Stanisław Osiński added a comment - 10/Dec/09 10:21 PM

Attachment from František.


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.