SmartSprites

Java error when output sprite becomes to high/wide

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.2.4
  • Fix Version/s: 0.2.5
  • Component/s: None
  • Labels:
    None

Description

I tried to create both Horizontal and vertical sprites with references in 241 css classes, each of them 11*16px. I got a crash here and reduced the numer of references one by one.

In both cases the max width and height seems to be 660px for the final output sprite.

The images where in PNG, but i don't know what PNG format.

The error output for the vertical sprite is:

Exception in thread "main" java.lang.NullPointerException
at org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.getRequiredWidth(SpriteReferenceOccurrence.java:46)
at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImage(SpriteImageBuilder.java:256)
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)

And for the horizontal sprite is:

Exception in thread "main" java.lang.NullPointerException
at org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.getRequiredHeight(SpriteReferenceOccurrence.java:65)
at org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImage(SpriteImageBuilder.java:256)
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)

BR
Patrik

Activity

Hide
Patrik Grinsvall added a comment -

Note:

This is however not the case if i make some images wider and deletes some css classes. The issue seems to be a combination of many css classes and a high total width. The number of css classes was 60 and below when it worked, more classes crashed the application.

BR
Patrik

Show
Patrik Grinsvall added a comment - Note: This is however not the case if i make some images wider and deletes some css classes. The issue seems to be a combination of many css classes and a high total width. The number of css classes was 60 and below when it worked, more classes crashed the application. BR Patrik
Hide
Stanisław Osiński added a comment -

Hi Patrik,

Thanks for the report! Would you be able to attach (or e-mail me privately) the design that is causing this?

Thanks,

S.

Show
Stanisław Osiński added a comment - Hi Patrik, Thanks for the report! Would you be able to attach (or e-mail me privately) the design that is causing this? Thanks, S.
Hide
Stanisław Osiński added a comment -

Hi Patrik,

I've eliminated one possible source of the exception (unsupported format of the image to include in the sprite), here's a binary that you may want to try:

http://download.csssprites.org/smartsprites-0.2.5-dev.zip

If the error still occurs, please e-mail me the design (CSS, images) that is causing the problems.

Thanks,

S.

Show
Stanisław Osiński added a comment - Hi Patrik, I've eliminated one possible source of the exception (unsupported format of the image to include in the sprite), here's a binary that you may want to try: http://download.csssprites.org/smartsprites-0.2.5-dev.zip If the error still occurs, please e-mail me the design (CSS, images) that is causing the problems. Thanks, S.
Hide
Stanisław Osiński added a comment -

Hi Patrik,

For the time being I'm resolving this as Cannot Reproduce. If you can share the design (CSS/images) that causes this problem, please let me know, I'm happy to investigate once again.

Cheers,

S.

Show
Stanisław Osiński added a comment - Hi Patrik, For the time being I'm resolving this as Cannot Reproduce. If you can share the design (CSS/images) that causes this problem, please let me know, I'm happy to investigate once again. Cheers, S.
Hide
Patrik Grinsvall added a comment -

Hi, Stanislav, from what i can remember the build posted in comment from 2/10 worked. I will test again later this week though. Maybe i had an unsupported file in the sprite.

Show
Patrik Grinsvall added a comment - Hi, Stanislav, from what i can remember the build posted in comment from 2/10 worked. I will test again later this week though. Maybe i had an unsupported file in the sprite.
Hide
Stanisław Osiński added a comment -

Thanks! Please try the 0.2.5 version (http://download.csssprites.org/smartsprites-0.2.5.zip) and let me know how it works.

S.

Show
Stanisław Osiński added a comment - Thanks! Please try the 0.2.5 version (http://download.csssprites.org/smartsprites-0.2.5.zip) and let me know how it works. S.
Hide
Stanisław Osiński added a comment -

Reopening to change resolution to "fixed".

Show
Stanisław Osiński added a comment - Reopening to change resolution to "fixed".

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
Not Specified
Original Estimate - Not Specified
Remaining:
0h
Remaining Estimate - 0h
Logged:
1h
Time Spent - 1h