Hey Ian,
The plugin code for the social popup plugin does not do any special processing of images posted to Twitter. Any service specific image processing is done by the Apple APIs used to implement the social popup plugin on iOS.
In fact, here’s the relevant code bits:
// native.showPopup("social") entry point int IOSSocialNativePopupProvider::showPopup( lua\_State \*L ) { // ... Lua::Ref listenerRef = NULL; // options.listener lua\_getfield( L, -1, "listener" ); if ( Lua::IsListener( L, -1, kEventName ) ) { // Create native reference to listener listenerRef = Lua::NewRef( L, -1 ); } lua\_pop( L, 1 ); // ... // Set up our SLComposeViewController, for the service type specified controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceType]; // ... // options.image lua\_getfield( L, -1, "image" ); if ( lua\_istable( L, -1 ) ) { int numImages = lua\_objlen( L, -1 ); if ( numImages \> 0 ) { bool noError = true; // table is an array of 'path' tables for ( int i = 1; noError && i \<= numImages; i++ ) { lua\_rawgeti( L, -1, i ); noError = AddImage( L, controller, listenerRef ); lua\_pop( L, 1 ); } } else { AddImage( L, controller, listenerRef ); } } lua\_pop( L, 1 ); // ... } static bool AddImage( lua\_State \*L, SLComposeViewController \*controller, Corona::Lua::Ref listenerRef ) { using namespace Corona; bool result = false; // pathService-\>PushPath( L, -1 ); CoronaLibraryCallFunction( L, "system", "pathForTable", "t\>s", CoronaLuaNormalize( L, -1 ) ); const char \*str = lua\_tostring( L, -1 ); if ( str ) { NSString \*path = [NSString stringWithUTF8String:str]; UIImage \*image = [UIImage imageWithContentsOfFile:path]; result = [controller addImage:image]; if ( ! result && listenerRef ) { // Create event PushEvent( L, str ); Lua::DispatchEvent( L, listenerRef, 0 ); } } lua\_pop( L, 1 ); return result; }
Outside of creating an SLComposeViewController for a specific service type, the call to [SLComposeViewController addImage] is where any service-specific image processing would occur. The Discussion section of that APIs docs states that:
Image size limits are dependent on the target service and are documented by the service provider.
After a quick browse through Twitter’s REST documentation, it seems that their constraints on images files are just based on file size, not resolution.
All that being said, it sounds like the limits that Twitter imposes to Apple are inconsistent with what’s allowed with their app or through the browser. Why that’s the case is a good question.
Also, the code for this plugin is open-source if you want to dive deeper into it. It’s available on GitHub here.
Hope that helps.