Get Image from Byte Aarray - iphone

Hope You all are fine and also in one of your best of moods!!
Hope You all are Enjoying iPhone development.
I herewith one issue that i am not able to solve, may be i don't know the depth concept of iPhone.
So Its my humble requet to you to guide me or suggest or share your ideas.
I do find an issue with getting an image from Bytes array.
I am calling a webservice which returns an image in form of Bytes Array as response.
I have Converted this bytes array in to form of NSData, Now i have NSData, But When i Try to get an image from this NSData, It shows nil.
I Did lots of R&D and Find one suggestion to use base64 encoder, But unfortunately because of not proper guidance I was not able to Implement that.
I was also suggested to use OPenSSL Library for base64 from url http://www.cocoadev.com/index.pl?BaseSixtyFour
But again i was not able to include #include #include these two files. as in Newer Version of SDK 3.X family Apple has depreciated those (as i guess).
So Now i need help from you guys. kindly help me if you have solution or if you know the steps to solve these.
Looking Forwards.
Regards,
Arun Thakkar

Using OpenSSL on the iPhone seems like a very heavy-weight solution if all you need is Base64 encoding/decoding. Look at this post for how to use a category for NSData to add base64 encoding/decoding. You want the second section of this blog post as the first deals with OpenSSL :)
base64-encoding-options-on-mac-and-iphone

Related

How does one add custom metadata tags to an image on the iPhone?

I tried adding custom entries in the exif dictionaries I received from an image. This didn't work. I'm assuming this is due to the fact exif is a standard that is already defined.
Basically I am trying to create a metadata tag that can be placed in jpegs that will have no character limit.
I read that XMP metadata tags do not have character limits. Is this true? If so how would I create these on the iPhone?
Thank you.
I'm not sure what you've all tried code wise, but Caffeinated Cocoa has a pretty good blog entry on Image Metadata that I've used in an application for a client a while ago that might help you.
Also, the SO post Problem setting exif data for an image looks like it references the Caffeinated Cocoa. Although this question is a little over a year old, it still might help.
Try giving these a shot.

c/c++/objective-c library for encoding mpegs

I am looking to encode a jpg sequence into an mpeg format on an iphone project I am working on. My google searches are coming up pretty short. Does anyone happen to know of a library that would let me do something like this?
have a look at ffmpeg
(more characters required)

"Untar" file on iPhone

I'm writing an iPhone app which downloads a tar-gzipped file from a Webserver, then needs to unarchive this file so that it can be copied into the app's Documents folder.
I'm using tar/gzip because I want to download a whole bunch of small files in one HTTP request, to make everything nice and fast.
I've investigated solutions like http://www.feep.net/libtar/, but as a C/Objective-C newb, I can't get any of them to compile for the iPhone platform.
(I felt like I should just be able to do a system call to "tar -zxvf myfile.tar.gz", but it would appear it's not that easy!)
So is there a simple way to just un-tar a file on the iPhone? Or am I going about this all wrong, and is there a better way to do this?
Thanks in advance!
Nik
This blog post should help you:
http://blog.hawkey.org/?p=332
EDIT: Google cache version of the same page which actually links to a forum post here which links to a Google Code project here, containing some code which implements unzipping on iOS.
Here is a light untar library for iOS : https://github.com/mhausherr/Light-Untar-for-iOS
Complete blog post about the solution : http://blog.octo.com/en/untar-on-ios-the-pragmatic-way/
Hope this helps,
Vincent
I took a different approach by building libarchive and bz2lib as a static library for iOS. You can find it here:
http://github.com/davepeck/iOS-libarchive/

iPhone using NSURLConnection to get multipart data is not working right

It seems that there is a bug in the NSURLconnection when you are getting multipart files, didReceiveResponse doesn't get called like the docs say between each part (see this). So I think I'm going to parse all of the data that is coming in. The format is text and binary(images) does anyone know of any code already to parse the nsdata object that is sent. Thank You.
ah, Yeah, it does. You may want to post your code or review the documentation. Perhaps your invoking NSURLConnection incorrectly.

Exif and iPhone files

Im using a library for extracting EXIF data from google code.
I assume with iPhone OS 3 that you can use UIImagepicker to do it.
I just want to be able to extract the f-Stop, Shutter Speed and ISO data from the image.
I want to discard the image and just use the information that I store up.
Would I end up extracting the tag data in the viewcontroller.m or h?
This part of coding seems to baffle me a little bit and I cant figure out what to put where.
Can anyone help me out? I still havent figured out XCode all that well.
Whatever executable code you have needs to go in a .m (implementation) file, not a .h (header file). The headers are just for declaring things like classes, protocols, and methods, not for any real processing work.
Are there any tutorials that you know of that explain using exif step by step?
im using the one found here -
http://iphone-land.blogspot.com/2008/06/geo-tagging-images-using-iphone-exif.html
However, for a newbie like me, its not all that thorough because im coming up with errors and i am not sure how to resolve them.
I guess im just shy in all this. need a good place to start
You will likely have trouble getting access to an images metadata if you get it via UIImagePickerController, due to the issues described in this question: UIImagePickerController and extracting EXIF data from existing photos