Null Pointer exception - WARN: No 'background-image' CSS rule next to sprite reference comment

145 views
Skip to first unread message

LeslieM

unread,
Jul 21, 2011, 5:16:44 PM7/21/11
to SmartSprites CSS Sprite Generator Users and Developers
Just starting to work with SmartSprite 0.2.8 on Windows.

The open source package I am working with has CSS that SmartSprite
does not seem to like.

This CSS causes it to blow up:

.hdrNameBg {
background:#ffffff url(images/header-bg.png) repeat-x; /** sprite-
ref: vtigersprite; */
}

with error:

WARN: No 'background-image' CSS rule next to sprite reference
comment: background:#ffffff url(imag
es/header-bg.png) repeat-x; /** sprite-ref: vtigersprite; */ (c:
\temp\themes\softed\style.css, l
ine: 67)
Exception in thread "main" java.lang.NullPointerException
at
org.carrot2.labs.smartsprites.SpriteDirectiveOccurrenceCollector.collectSpriteReferenceOc
currences(SpriteDirectiveOccurrenceCollector.java:126)
at
org.carrot2.labs.smartsprites.SpriteDirectiveOccurrenceCollector.collectSpriteReferenceOc
currences(SpriteDirectiveOccurrenceCollector.java:185)
at
org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites(SpriteBuilder.java:
198)
at
org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites(SpriteBuilder.java:
147)
at
org.carrot2.labs.smartsprites.SmartSprites.main(SmartSprites.java:46)

Changing the CSS code to the following allows the process to get
further (and hit an exception on the next background image):

.hdrNameBg {
background:#ffffff;
background-repeat: repeat-x;
background-image: url(images/header-bg.png); /** sprite-ref:
vtigersprite; */
}

Is there an easy way to get SmartSprite to support the shorthand
background properties, or do I need to hand edit them all to make them
explicit?

Stanislaw Osinski

unread,
Oct 14, 2011, 5:07:46 AM10/14/11
to smartsprites-css...@googlegroups.com
Hi Leslie,

SmartSprites currently does not support shorthand properties, so for the time being you'd need to stick with the extended notation. But the NPE shouldn't happen anyway, thanks for the report!

Cheers,

Staszek


--
You received this message because you are subscribed to the Google Groups "SmartSprites CSS Sprite Generator Users and Developers" group.
To post to this group, send email to smartsprites-css...@googlegroups.com.
To unsubscribe from this group, send email to smartsprites-css-sprit...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/smartsprites-css-sprite-generator?hl=en.


Stanislaw Osinski

unread,
Feb 15, 2013, 9:42:18 AM2/15/13
to krysa...@gmail.com, smartsprites-css...@googlegroups.com
Hi Krysa,

As you may have seen in other threads, I'm swamped with other work, so I won't be able to add support for shorthand properties in the near future. If you have time to fork SmartSprites and make the changes, I'd be happy to pull them in and make part of the next release.

Thanks,

Stanislaw

On Fri, Feb 15, 2013 at 11:25 AM, <krysa...@gmail.com> wrote:
Hi Stanislaw,

First of all thanks for your tool it is so powerful and well thought that a child can use it ;)
Do you plan to manage the shorthand properties at some point? I am working on a huge application that have thousands of css rules (not the best part of the application code ;)) and most of them are in a short syntax.
I loved your tool to be able to handle that properly and not me to check backgrounds. As I am working with teams and I don't want them to be forced to use a syntax (We are already doing so much in house stuff that box us).
Otherwise we will write a tool or improve yours (Which will take longer that to you).

regards
Staszek


To post to this group, send email to smartsprites-css-sprite-gene...@googlegroups.com.
To unsubscribe from this group, send email to smartsprites-css-sprite-generator+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages