Giter Club home page Giter Club logo

Comments (5)

lericson avatar lericson commented on July 20, 2024

Well, initially the goal was to cover both background-image and background. I just never got around to implementing the latter, because of complications involved and deadlines. So the proper thing to do here is to either a) file a new ticket saying we should support background-image and retract the current half-assed implementation, or b) fix it.

from spritemapper.

lericson avatar lericson commented on July 20, 2024

To elaborate: the problem is that you'd need to emit additional CSS syntax, not just modify existing. While possible, it's a different beast. You'll see what I mean if you look at the replacing code, https://github.com/yostudios/Spritemapper/blob/master/spritecss/replacer.py#L27

from spritemapper.

olivierphi avatar olivierphi commented on July 20, 2024

Ok, I see what you mean : the CSS modifications seem to be simple "search/replace" on background CSS properties. Covering background-image would require the setting of an additionnal background-position property in the CSS block.

Unfortunately, I'm not a python coder, therefore I can't even try to fix it myself...

Thanks for your answer !

from spritemapper.

schiebs avatar schiebs commented on July 20, 2024

I'm having trouble getting sitemapper to work at all.
If I use the full background property, e.g.:

background: transparent url(images/some.gif) no-repeat scroll 0 0;

I get a sm_style.css, that's identical to style.css, and no sprite image output.

As mentioned here, if I separate the background properties into background-color, background-image, etc, sitemapper doesn't handle it.

In an attempt to get something out, I tried simply:

background: url(images/some.gif);

on a couple rules, and I get the error

File "C:\Python27\lib\site-packages\spritecss\png.py", line 1667, in validate_signature
  raise FormatError("PNG file has invalid signature.")
spritecss.png.FormatError: FormatError: PNG file has invalid signature.

I believe spritecss.png is the sprite image file you are creating.
I have tried this on Windows XP and Windows Server Enterprise systems using Python 2.7.

from spritemapper.

lericson avatar lericson commented on July 20, 2024

Spritemapper only handles background, and cannot handle GIF images. If you feel this was not clear from the documentation, please file an issue suggesting where we should tell people about it.

No, spritecss.png is a module path. It is complaining that it cannot open the given file, because it is not a PNG. Please do not hijack issues like this.

Edit: The reason your first declaration doesn't work is that it specifies background positions; these are probably not sprites.

from spritemapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.