Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 01-06-2009, 11:36 AM   #14 (permalink)
narut
Registered Member
 
Join Date: Nov 2008
Posts: 43
Default

Quote:
Originally Posted by cmezak View Post
Yeah. I found that handling the transforms to correctly orient the images was the most tricky part. The documentation for this is not clear. Also, I found that images from the photo library come out pink. I couldn't resolve this, but since my app is using images from the camera (which come out just fine) it's not a big deal for me.

Good luck!

- Charlie
First of all, thanks for the code cmezak. You really did save my life.

I'm totally newbie about Quartz, but from trial and error, I've managed to get the code working for both camera and library.
Looks like the photo from library turn pink because CGImageGetBitsPerComponent(imageRef) will always return 5 bits per component (got 8 bits from camera images).
I'm not sure if the Generic RGB Color Space returned from CGColorSpaceCreateDeviceRGB() will assume that you use 8 bits/component picture. So that's why only the images from library was not processed properly.

Here's what I do
Code:
bitmap = CGBitmapContextCreate(NULL, longSide, shortSide, 8, image.size.width*3, 
CGColorSpaceCreateDeviceRGB(), alphaInfo);
Not even sure if there would be any bad side effects for harding code like this. But I think I'm gonna keep it this way until I learn more about Quartz things.
narut is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,871
Threads: 89,225
Posts: 380,695
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Darmanikles
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:49 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.