I've got an app that is generating thumbnails of images at runtime. But they're not in the optimized format that Xcode creates when images are added to a project. Is there a library or a function call I can use to convert these images?
Asked
Active
Viewed 225 times
1 Answers
0
Instructions:
- Download DHowett (thanks, DHowett!) code from: https://github.com/DHowett/pincrush
- Unzip and rename to DHowett and place next to the XCode sample project I placed (https://www.box.com/s/7dfb3e6f430d98d933c2), and run...
If/When you build your own project from scratch, then do the following immediately after unzipping and BEFORE adding the folder to your project:
- Remove all makefile files from the folder
- Drag the folder to your project
- To overcome compiler warning "implicit declartion of function 'pincrush' is invalid in C99", changed project setting "C Language Dialect" to "GNU89"
- When building, you'll get an error "'png.h" file not found" - to fix it, add DHowett/libpng to the project's Header Search Paths
- open pincrush.c and comment out the "usage" and "main" functions (you don't need them, and the first causes compilation error, the second causes link errors)
- Add an external reference to crush... See below: extern void crush(const char *infilename, const char *outfilename);
- You can ignore the 8 compilation warnings of "Unused Entity Issue" caused by the "NEXT" macro
You may need to remove the .git* files from the project (some annyoing warnings...)
Enjoy, good luck!

Reuven
- 2,142
- 3
- 18
- 30
-
Thanks Reuven for the response, It looks like pin crush from DHowett might work if only I could get it to build. Pngnq is a command line tool. – Jacob White May 24 '12 at 13:49
-
I'm not sure how to implement that into my project. – Jacob White May 26 '12 at 04:58
-
Updated the answer, with a sample project. HTH. Reuven – Reuven May 30 '12 at 10:49
-
@JacobWhite, any progress? Anything more I can help with? – Reuven Jun 06 '12 at 06:12