-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
Compile failure with USE_COCOA flag #48
Comments
Also I don't know if it is related with this issue but the official CLI builds from http://pngquant.org/ are giving me segmentation fault and "illegal instruction: 4" in another machine. Both are using OS X 10.7, it works just fine in 10.8. |
It looks like your compiler doesn't have Cocoa headers in search path. I'm not sure how to make that work, because Can you compile this?
The change in saturation is due to color profile support in Cocoa. With stock libpng pngquant can't support color profiles, and dropping of color profiles often increases saturation. With Cocoa it loads images as sRGB and saves them tagged as sRGB, so the less saturated version is actually more accurate representation of the image. I've rebuilt the executables with |
The I managed to compile rwpng_cocoa.m but I had to change It also worked by installing with Homebrew Regarding the CoreGraphics.h issue I based on this solution http://stackoverflow.com/a/4173621/1183663, my experience with Objective-C is minimal. Changing #include to #import also worked:
I don't know why it cannot find CoreGraphics.h by default, I have the latest Xcode and the command line tools installed. |
I've previously only specified OS version in compiler flags, rather than linker flags. It's odd, but it seems that OS X doesn't have public libpng. I'm haven't checked whether X11 lib directory exists on stock OS X. If it doesn't, then compilation will fail. |
Just tested with Mountain Lion with only X Code and indeed it fails to compile. There is a directory The solution seems to be to install xquartz or libpng with Homebrew. |
Do you have png.h anywhere else? ( |
hmmm, this what I found on the Mountain Lion system:
|
Nothing on 10.8 (without X11), except for the one i installed with Homebrew... |
Yeah, so that's a pretty sad state. Cocoa has lousy support for saving PNG, so I can't do much without libpng anyway. |
@pornel can you include libpng in the build so people don't have to fetch external dependencies? |
The Mac binaries on pngquant.org are statically linked and don't require external libpng. Inclusion of png.h in pngquant repository would be controversial. |
Hi,
Firstly, thumbs-up for this util!
I have a problem building from source when using USE_COCOA=1
(in v2 there is an extra error in the Makefile)
The solution is to change the import in rwpng_cocoa.m:
Want a pull request to fix this issue?
p.s. why the colors appear a bit desaturated when using the cocoa build? Something to do with the color profiles? Check here http://dabblet.com/gist/6351700
The text was updated successfully, but these errors were encountered: