I'm working on an application that handles image editing, and I'm at the point where I'm trying to integrate twitter. So far it has worked great and I can send a tweet from within the app and attach the image the user is editing. The drawback that I've noticed, is that the image gets auto-compressed. This means that the PNG the user is editing, if it has transparency, no longer will have transparency. This isn't good. Is there a way around this? I would like to be able to send a tweet and attach my PNG image WITH transparency, basically keep it from converting to a JPG once sent.
Here's the code I have so far. Very self-explanatory and straightforward.
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType: SLServiceTypeTwitter];
[tweetSheet addImage:self.workingImage];
[self presentModalController:tweetSheet animated:YES completion:nil];
self.workingImage
is the image the user is working on.
EDIT: I've updated the above code to work on iOS6, and seem to have the exact same problem (which isn't too surprising I guess). It looks like once the image is on Twitter, it is in JPG format. Is there any way to keep in PNG format?
I'd hate to lose all of this simple code only to go down the route of using a 3rd party image hosting site.
EDIT 2: I've now converted all of my code to no longer use the alpha channel. This means that I no longer care if the image is in the format of PNG or JPEG, because all 3 RGB channels will always exist. Posting a tweet still compresses the image before posting it, no matter what quality the original image was.
I even posted an image to twitter using the app, had it compressed by twitter, saved the image and tried to repeat using the newly compressed image, yet twitter still compressed!
I'm lost on this. Will twitter (or even facebook) compress images no matter what? Will my only option be a third party image hosting site? I'd hate to lose all of the nice social features the iOS6 framework has built into it to instead use a third party site...