Is it possible to upload an animated GIF with TWTweetComposeViewController?
I gave it a try with UIImage, and it only uploads the first frame. This makes sense, since UIImage doesn't support animated GIFs.
Is there a way to do this? Maybe a way to pass an NSData?
(My app is MonoTouch C#, but Objective-C answers work just as
well)
Follow This Link http://blog.stijnspijker.nl/2009/07/animated-and-transparent-gifs-for-iphone-made-easy/ It has the library to insert GIF images into UIImageView
You are correct - Twitter's official API documentation does not allow animated gif - only png, jpeg and one frame of gif is allowed
Here is their api doc page
I also tried the example for TWrequest post using multipart image data set to the raw Gif file and twitter sent back 400 / 403 error message
I'm assuming there isn't a way to do this.
Related
I have a game that I've been working on for iOS. We let our users tweet the results of their games and I thought it'd be fun to add a badge or something to the tweet to show details.
I create an image using UIKit. Then, I attach that image in iOS 6.0 with -[SLComposeViewController addImage:] or in iOS 5.* with [TWTweetComposeViewController addImage:] but neither of them will attach an the image.
If I use Facebook or Weibo, the image attaches fine. With Twitter, no luck at all.
Has anybody had any luck attaching an image to a tweet?
If you're receiving NO for the return value of TWTweetComposeViewController, the documentation says: YES if successful. NO if image does not fit in the currently available character space or the view was presented to the user.
I'm wondering if it's possible to have a slide with text AND add some animation into it for an iPad app. See screenshot below to get an idea of what I need. I want that guy jump up and down and smile. I'm sure I'm not capable of drawing that image using Objective-C primitives myself, so I'm looking at the following options:
Do complete animation in 3rd-party tool (Adobe?) and then add it as single standalone file on the slide. But I do not know, what formats are supported in iOS, what are standard formats, and, at the end, how to insert that file on the slide. Can somebody clarify this please?
Do complete animation, and then save frames as images, and then quickly change images to give illusion of a movie.
Am I missing something? Are there any other ways? what's the best option?
Please let me know if I'm not clear enough - I will try to provide more information.
Thank you.
If you want to use a movie file for the animation, you can find the supported video formats in the iOS Technology Overview, under “Media Layer > Video Technologies”. You will need to use an AVPlayerLayer from the AVFoundation Framework to show the video.
If you want to use a separate image file for each frame, you can use one of the +[UIImage animatedImage...] methods to create an animated UIImage, and display it in a UIImageView.
If you want to use a single animated GIF for the animation, you can use this public domain UIImage+animatedGIF category to load the GIF into an animated UIImage, and display it in a UIImageView.
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...
It's a twitter side problem. It compress your image regardless. Maybe you should consider uploading the .png to your own server then post a link of it within the tweet.
you can also use other image hosting services..
I'm trying to capture one or more UIImages programmatically using AVFoundation.
I set up the sessions and input devices and everything, but when I try to find explanations on how to actually take the photos, all I get is buffeled information about connections and what not.
I couldn't find a single example of actually taking photos and saving it to UIImage for further processing. All the example use a constant kCGImagePropertyExifDictionary Which doesn't seems to exist in iOS 5 SDK..
Can someone please provide me with a code or an explanation from top to bottom on how to take and save an image from the front facing camera to a UIImage using AVFoundation?
Thanks alot!
To use kCGImagePropertyExifDictionary, you should #import <ImageIO/ImageIO.h>.
All of the other information you seek is inside the AVFoundation Programming guide - particularly the Media Capture section.
Let's say I have a thumbnail image and I have an original image(about 1200 * 1600) on my server. What is the best way for users to see the full screen of the original image on iPhone?
I could send HTTP request to download the image but how can I show the image on the full screen? Also. If I download the full size image then is this bed for memory management?
Use a UIImageView in your UI, download the fullscreen image to disk, create a new image using UIImage's imageWithContentsOfFile:
+ (UIImage *)imageWithContentsOfFile:(NSString *)path
and eventually assign the image property of your UIImageView instance to this newly created image.
To download the fullscreen image, do not use synchronous methods like NSData's dataWithContentsOfURL or it will block your UI. Instead use the asynchronous methods of NSURLConnection.
See the Loading Data Asynchronously section of NSURLConnection Class Reference.
The full image seem to be appr. 12 times larger than the standard iPhone 320x480 screen. I think you can pre-render a down-scaled image to download for this and not feel about that.
Automator is a simple way to batch process this for you. See this vid.
http://www.youtube.com/watch?v=q7p081Ui9WY