Changing output path of sprite image

28 views
Skip to first unread message

Brian Morton

unread,
Oct 11, 2011, 5:00:39 PM10/11/11
to SmartSprites CSS Sprite Generator Users and Developers
This tool is absolutely tremendous and it is exactly what I have been
searching for. One small problem I have is that my site is laid out
as follows:

/home/website/public => /
/home/website/public/css => /css
/home/website/public/images => /images

With a build command like this:
sh smartsprites.sh --root-dir-path ~/website/public/

or even like this:

sh smartsprites.sh --root-dir-path ~/website/public/ --output-dir-
path /tmp/ --document-root-dir-path ~/website/public/

My sprites wind up at:

/<output-dir-path>/img/mysprite.png

Is there any way to control the img part of the path/URL? The path
isn't so bad, but the URL in the resulting sprite.css files is a
problem since my images don't reside at /img. I've hunted through the
source code but cannot find anything useful to resolve this problem.

Thanks,

Stanislaw Osinski

unread,
Oct 12, 2011, 1:57:07 AM10/12/11
to smartsprites-css...@googlegroups.com
Hi Brian,

The paths in sprite definition directive are relative to the CSS they're declared in, so if you go:

/** sprite: mysprite; sprite-image: url('../images/mysprite.png'); sprite-layout: vertical */

then the images should end up in your images/ dir. With that change, SmartSprites yout invocation can be something like:

./smartsprites.sh --root-dir-path ~/website/public/

Let me know if this did the trick.

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.


Brian Morton

unread,
Oct 31, 2011, 11:48:08 AM10/31/11
to SmartSprites CSS Sprite Generator Users and Developers
Stanislaw,

That was very helpful. Thanks so much.

On Oct 12, 1:57 am, Stanislaw Osinski
Reply all
Reply to author
Forward
0 new messages