Compass / compass

Compass is no longer actively maintained. Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain.
http://compass-style.org
Other
6.72k stars 1.18k forks source link

NoMethodError from chunky_png while generating sprites #1311

Open neilrenicker opened 11 years ago

neilrenicker commented 11 years ago

I'm consistently getting the above error with a fairly simple sprites setup.

Here's my config.rb:

css_dir = "dist/css"
sass_dir = "scss"
sass_options = { :debug_info => true }
images_dir = "public/images"

Here's my file structure:

|_dist
|  |_images
|     |_social
|       |_facebook.png
|       |_twitter.png
|       |_flickr.png
|_public
|  |_images
|     |_social
|       |_facebook.png
|       |_twitter.png
|       |_flickr.png

Here's my sprites import in my .scss file:

@import "social/*.png";
@include all-social-sprites;

Here's the full error:

NoMethodError on line ["24"] of /Users/neilrenicker/.rvm/gems/ruby-1.9.3-p125@Redacted/gems/chunky_png-1.2.8/lib/chunky_png/chunk.rb: undefined method `unpack' for nil:NilClass
scottdavis commented 11 years ago

need some more critical information: Operating system Ruby version Compass version are you using oly_png?

neilrenicker commented 11 years ago
neilrenicker commented 11 years ago

OK, I have more info and a fix on this issue. I opened the original PNG files in Photoshop and re-saved them with 'Interlaced' turned off (as per this stackoverflow answer).

Could Compass add descriptive error handling to make this easier to debug in the future?

chriseppstein commented 11 years ago

Well that sucks. @wvanbergen any advice on how we can detect this? Should we consider this a bug in chunky_png?

wvanbergen commented 11 years ago

Looks like it. Is it possible to get me a copy of the image in question?

kikambus commented 6 years ago

I have the same problem. In my case it was loss of one image by sprite. After added it back, everything works fine. It's funny becouse usually Sass always said about it, but in this case Sass decide said about it like "undefined method `unpack' for nil:NilClass".

Hope it's help someone.