Re: Adding optional same directory check to SmartSprites

24 views
Skip to first unread message

Stanislaw Osinski

unread,
Jul 26, 2012, 2:21:24 PM7/26/12
to smartsprites-css...@googlegroups.com
Hi,

I don't quite get it -- can you provide a specific example?

Thanks,

Staszek

On Thu, Jul 26, 2012 at 8:14 PM, Eugene Neymark <eugene....@gmail.com> wrote:
Hi all,

Would it possible to add functionality to check if all the assets and generated sprite reside in the same directory?
It could a an optional flag to check for this. This functionality is useful to enforce sprites being checked in into the same folder.

Thank you!

Eugene

--
You received this message because you are subscribed to the Google Groups "SmartSprites CSS Sprite Generator Users and Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/smartsprites-css-sprite-generator/-/BAMk0CL9a-kJ.
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.

Eugene Neymark

unread,
Jul 26, 2012, 3:38:14 PM7/26/12
to smartsprites-css...@googlegroups.com, stanisla...@carrotsearch.com
Thank you for a quick response!

I was thinking of an additional way of enforcing that every image that is used to generated the sprite, and the generated sprite reside in the same directory.

The example would be:
/* sprite: mySprite; sprite-image: url(/static/images/mySprite.png); sprite-layout: vertical */

.result .body {
    background-image:url(/static/images/Bkgd.png);/** sprite-ref: mySprite*/
}
.result.super .body {
    background-image:url(/static/images/DIFERENT-FOLDER/ABkgd.png);/** sprite-ref: mySprite*/    <--- Wrong. Throw an exception if optional check folder flag is set to true.
}


On Thursday, July 26, 2012 11:21:24 AM UTC-7, Stanislaw Osinski wrote:
Hi,

I don't quite get it -- can you provide a specific example?

Thanks,

Staszek

On Thu, Jul 26, 2012 at 8:14 PM, Eugene Neymark <eugene....@gmail.com> wrote:
Hi all,

Would it possible to add functionality to check if all the assets and generated sprite reside in the same directory?
It could a an optional flag to check for this. This functionality is useful to enforce sprites being checked in into the same folder.

Thank you!

Eugene

--
You received this message because you are subscribed to the Google Groups "SmartSprites CSS Sprite Generator Users and Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/smartsprites-css-sprite-generator/-/BAMk0CL9a-kJ.
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.

Stanislaw Osinski

unread,
Jul 26, 2012, 5:30:16 PM7/26/12
to smartsprites-css...@googlegroups.com
I was thinking of an additional way of enforcing that every image that is used to generated the sprite, and the generated sprite reside in the same directory.

The example would be:
/* sprite: mySprite; sprite-image: url(/static/images/mySprite.png); sprite-layout: vertical */

.result .body {
    background-image:url(/static/images/Bkgd.png);/** sprite-ref: mySprite*/
}
.result.super .body {
    background-image:url(/static/images/DIFERENT-FOLDER/ABkgd.png);/** sprite-ref: mySprite*/    <--- Wrong. Throw an exception if optional check folder flag is set to true.
}

If the file cannot be loaded, you should see a warning in the logs -- isn't that enough?

Staszek

Eugene Neymark

unread,
Jul 27, 2012, 2:05:26 PM7/27/12
to smartsprites-css...@googlegroups.com, stanisla...@carrotsearch.com
Hi Stanislaw,

It's somewhat different. I see something along the lines of adding an option to check if every file which is read into the sprite and the sprite itself are all in the same folder. If one of them is outside of that folder, it can warn about it.
As to reasons why?
In my case, the assets are version controlled, and then cached, I want to be able to tell which version of sprite is the latest.
By relying on that assets from which sprite is composed are all in the same folder, we don't have to version control the generated sprite and still can tell when to serve up new sprite from the cache.

Eugene Neymark

unread,
Jul 27, 2012, 3:42:26 PM7/27/12
to smartsprites-css...@googlegroups.com, stanisla...@carrotsearch.com
I understand that this might not be a very common usage pattern for everyone else. I'm more than happy to make the code changes if they can be incorporated in the future versions of SmartSprites.

Thanks!

Stanislaw Osinski

unread,
Jul 27, 2012, 3:52:03 PM7/27/12
to smartsprites-css...@googlegroups.com
To be honest, I'd keep this outside of the SmartSprites code base, the feature seems very specifically tied to your architecture. You can always write a script that would check the image locations before SmartSprites is invoked. Obviously, you can also fork SmartSprites on GitHub and play with the code.

Saszek



--
You received this message because you are subscribed to the Google Groups "SmartSprites CSS Sprite Generator Users and Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/smartsprites-css-sprite-generator/-/m1e7zYipCuYJ.

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.
Reply all
Reply to author
Forward
0 new messages