New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corrupt PNG on sprite - System Crash #860
Comments
Hi there I just had the same experience - nearly systemwide crash when trying to compile a sass project with sprites. With jpegs named as png cmpass/ruby eats up all memory. On my system [OS X 10.7.3] cpu usage was still low but it wanted to use several GBs of ram. So finally this is not really a bug - as the problems are caused by the user :) But maybe it would be possible to avoid a freeze... |
This is a bug as Compass crashed my system, the user error did not cause the system crash, compass did. |
Yes it should maybe not rely on the file extension to determine the image type. |
this sounds like an issue with the png library and not compass... lets ping @wvanbergen |
This is not a problem in ChunkyPNG. The attached image is a JPEG, not a PNG image. Trying to read it with ChunkyPNG is raising an error, as expected:
My guess is the error handling in Compass may not handle this exception properly. |
so ChunkyPNG::SignatureMismatch is an exception i can catch then? |
Yeah, or just |
rather be specific in my catch so i can display a proper error message consider this on my list of things to get done. |
Thank you guys, much appreciated. |
This is still kind of an issue. Somehow (don't ask me how), a PSD file got saved as a PNG file and checked into the project. The PSD was smallish (33 KB), so it wasn't super obvious. Anyway, basically when I tried to compile a sprite sheet, ruby ended up leaking a huge amount of memory, (in Activity Monitor, it showed over 13GB of actual used memory). This is, of course, insane, there needs to be a better way of handling and catching something like this. The first time I tried it, the process just hung (terminal was in the background and I was doing something else), all of a sudden my comp just crashed. When I rebooted and tried to run it again, I noticed the hung process and opened Activity Monitor. Took me a lot of trial and error to discover the issue and the PSD saved as a PNG. Ideally, Compass/ChunkyPNG would be able to spit some kind of warning/error out. I'm not sure if this is a ChunkyPNG or Compass error however. |
Had this as well, could someone please add lines in verbose mode to explain what files compass is looking at as it moves through sprite generation? |
Compass Version 0.11.7
SASS Version 3.1.7
Mac OS X 10.7.3
It's possible for compass to cause a system wide crash if it attempts to create a sprite from corrupt png.
I was updating an existing sprite image by working in photoshop, I saved this file and put it in my sprite directory, edited some SCSS when compass watch kicked in and started eating up all of my computers resources.
It took me a while, and several computer restarts, to find out why my computer was being so slow until I managed to open my finder and delete the corrupt png at which point compass compile threw a file not found error when trying to create the sprite.
I reopened photoshop, re-saved the file and everything was fine. I'm not sure what was wrong with the image as it opened and displayed in Preview, but opening it in photoshop I got this error "Could not complete your request because the file-format module cannot parse the file."
The problem was reasonably difficult for a dev to spot before trying to create a sprite, and if the sprite generator kicks in a computer restart is required for it to become responsive again.
I still have the problematic png here http://thomas.clicklabs.co.uk/corrupt-png-compass-test.png
The text was updated successfully, but these errors were encountered: