0

I've been doing a lot of work on build automation in PHP for a framework library. I was about to start bashing at the keyboard when I thought... "someone's got to have done this before".

However after some digging I haven't found anything which can do exactly what I'm after and thought I'd ask around here:

I need a PHP script which can:

  1. Take a preset directory full of images (jpg/png/gif mixed)
  2. Sprite them all together into one file i.e. "UI.png" or something
  3. Open up a bunch of css files & scan for instances of the individual files
  4. replace the src url()
  5. Adjust any existing background positioning rules

It sounds like a lot to do but I can't be the first person to be considering this can I?

I've seen a few scripts around which do either the first part or attempt to do the 2nd part but with a tonne of config comments which I'd rather avoid.

Any ideas?

3
  • May the force be with you. Always. Commented Aug 29, 2012 at 14:11
  • lol... yer... was hoping that some yoda had been here before... Commented Aug 29, 2012 at 14:52
  • It seems like quite a big ask. But I don't know much about PHP so maybe it's not, sorry I can't be of more help! Commented Aug 29, 2012 at 14:53

1 Answer 1

1

I found a tool that could help you: https://code.google.com/p/scrinker/ . It shrinks css files and automatic generates rudimentary sprites like icons by just adding /[[SPRITE]]/ to your background declaration.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.