Comments (5)
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.
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.
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.
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.
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)
- Skip unsupported image formats HOT 1
- Mac / Linux installs HOT 3
- parser fails on inline @media blocks HOT 6
- fail with extjs-3.4.0 HOT 4
- Optimize your CSS HOT 1
- Support for simple repeat-x and repeat-y images HOT 2
- Adding timestamp to spritemaps filenames HOT 1
- Automation Sprites Generation
- spritecss.png.FormatError: FormatError: PNG file has invalid signature. HOT 1
- compact form for background is not handled HOT 1
- Make cssutils and PIL optional dependencies to increase Spritemapper's reliability
- I suggest to don't use relative import in SpriteMapper project
- Error:spritecss.main: image : not readable HOT 1
- PNG output, but not CSS
- Add option for outputting image dimensions
- Unable to run >> Using Python 3.3 on Windows HOT 5
- no JPEG support
- Spritemapper on Windows w/ Python 2.7.8 not working
- Small bug in documentation on homepage
- No documentation installed using windows installer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spritemapper.