Giter Site home page Giter Site logo

Large Photos Won't Upload about sttwitter HOT 6 CLOSED

nst avatar nst commented on July 19, 2024
Large Photos Won't Upload

from sttwitter.

Comments (6)

nst avatar nst commented on July 19, 2024

Thank you for reporting issues! Let me know which STTwitterAPI method is so slow and I'll do my best to optimize it.

from sttwitter.

inb4ohnoes avatar inb4ohnoes commented on July 19, 2024

Thank you for replying! The convenience method for posting a status with a picture is the one that I'm having issues with. I have not tried the other method.

from sttwitter.

nst avatar nst commented on July 19, 2024

I can't manage to reproduce the issue.

I uploaded photos taken with an iPhone 5 while connected on wifi.

It took around 10-15 seconds, depending on the compression rate.

Here is the code I used to post https://twitter.com/nst021/status/402144049488224256

Is this very same code stalling for you?

- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info {

    UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];

    NSData *data = UIImageJPEGRepresentation(image, 0.5);

    [_twitter postStatusUpdate:@"test"
                mediaDataArray:@[data]
             possiblySensitive:nil
             inReplyToStatusID:nil
                      latitude:nil
                     longitude:nil
                       placeID:nil
            displayCoordinates:nil
                  successBlock:^(NSDictionary *status) {
                      // ...
                  } errorBlock:^(NSError *error) {
                      // ...
                  }];
}

from sttwitter.

inb4ohnoes avatar inb4ohnoes commented on July 19, 2024

Oh no I was using the one where you have to put an NSURL

from sttwitter.

nst avatar nst commented on July 19, 2024

OK I just tried to upload a 3.2 MB photo and I get the following error from Twitter's server:

{
    errors =     (
                {
            code = 193;
            message = "One or more of the uploaded media is too large.";
        }
    );
}

So:

  1. be sure to handle the error properly
  2. prefer the alternative way I posted before

from sttwitter.

inb4ohnoes avatar inb4ohnoes commented on July 19, 2024

Hmm. I just get never ending uploading or a timeout error when I do that... I'll use the other method. Thanks!

Edit: I was about to report back saying this wasn't working either when i realized i was setting the image data to nil before it could finish uploading. good job me.

from sttwitter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.