Update status with media_id results in a thumbnail size image


#1

Using REST Api to upload media that is 4240x2832 pixels using media/upload and then sending in media_id with status/update. The image doesn’t fill 100% width of my feed and then when you click on the image, the popup displays at a thumbnail size image (300x200 pixels). This is the image url that was shared to Twitter: https://pbs.twimg.com/media/Cx6DcQxXcAE5egH.jpg:large

Do I need to specify a size when posting to media/upload or to status/update? Or can anyone explain what’s happening?

Update: Original file size is 452kb


#2

This is pretty unusual. Can you share more about your process (in code) for uploading images and attaching to Tweets? I am not aware that this should modify how media is rendered on the platform.


#3

I’m using themattharris Utilities and OAuth libraries for authorization, and then in my callback file after getting token I’m doing the following:

//upload media using encoded image
$image_data = file_get_contents($img_url);
$encoded_image = base64_encode($image_data);
$upload_code = $tmhOAuth->request('POST', 'https://upload.twitter.com/1.1/media/upload.json',
    array(
        'media_data' => $encoded_image,
    ),
    true, // use auth
    true // multipart
);

//decode the response to get the media_id for that media
$json = json_decode($tmhOAuth->response['response'], true);
$media_id = $json['media_id_string'];

//update status with media_id and provided text
$status_code = $tmhOAuth->request('POST', 'https://api.twitter.com/1.1/statuses/update.json',
    array(
        'media_ids' => $media_id,
        'status' => "$txt" 
    ),
    true, // use auth
    false // multipart
);

All functionality works as expected, except for the image being extremely small.

Here are two screenshots for reference: http://adobe.ly/2fD2DUd http://adobe.ly/2gmd7Jp