InstagramApiSharp icon indicating copy to clipboard operation
InstagramApiSharp copied to clipboard

"int too big to convert" on uploading media

Open haririan opened this issue 10 months ago • 11 comments

Important note

  • You must fill this form! If you don't fill it, your issue will be close immediately.
  • Put an X character between [ ] that is related to your issue, like [x]
  • Please remove Important note from this form!
  • Don't remove other sections (unless it's unnecessarily, like Debug logs and Screenshots sections)!

I've:

Issue category

  • [ ] Bug
  • [ ] Feature Request
  • [ ] Missing Feature
  • [ ] Question
  • [x] Not sure

Language

  • [x] C#
  • [ ] VB.NET

Usage

  • [ ] Windows Form/Console app
  • [ ] WPF app
  • [ ] Asp .NET MVC
  • [x] Asp .NET Core
  • [ ] Universal Windows Platform [UWP]
  • [ ] Xamarin or Xamarin Forms
  • [ ] Mono
  • [ ] Other

Operating System

  • [ ] Windows
  • [ ] Windows Server
  • [ ] Linux
  • [x] Mac OS
  • [ ] Other

Describe your issue

this is how i try to add image var mediaImage = new InstaImageUpload {

            Height = 0,
            Width = 0,
            Uri = @"ali.jpg"
        };
     
        var result = await api.MediaProcessor.UploadPhotoAsync(mediaImage, "COMMENT");
      

Screenshots

image

haririan avatar Apr 08 '24 12:04 haririan

Hello, were you able to solve the problem?

fancifulcoder avatar Apr 28 '24 22:04 fancifulcoder

I am also facing the same issue in .net core. image

SailleshPawar avatar May 06 '24 05:05 SailleshPawar

I was able to solve it this way.

image

image

fancifulcoder avatar May 06 '24 08:05 fancifulcoder

@fancifulcoder I am still facing the same error. Though If I use the repository examples project it works for me seems like some library is missing for me.

SailleshPawar avatar May 08 '24 04:05 SailleshPawar

@fancifulcoder or @SailleshPawar did you come up with a solution? I'm facing the same error. I'm using a jpg of 115kb, so it's already very small.

rickmsg79 avatar Jun 06 '24 01:06 rickmsg79

@rickmsg79 I just stopped using this library due to no support of .NET core.
If you use the sample project in the repo and use the required dependencies then it works fine,

SailleshPawar avatar Jun 06 '24 05:06 SailleshPawar

@SailleshPawar thanks! what do you end up using for net core? another library?

rickmsg79 avatar Jun 06 '24 11:06 rickmsg79

got the warning from instagram that the account will be blocked so stopped using it and stopped the poc for now.

SailleshPawar avatar Jun 22 '24 07:06 SailleshPawar

I have the same problem here, however, I decided to create my own service within my project, which handles the entire oAuth flow until sending the media.

There is no way to depend on this component.

marciusbezerra avatar Aug 08 '24 15:08 marciusbezerra

To fix the error, I did this in the source code I received...

image

The method was returning a very large number that should just be an integer for Instagram.

This way it worked, if they accept a PullRequest I can even send it, but for now I'm using it this way for myself.

marciusbezerra avatar Aug 18 '24 05:08 marciusbezerra

Hi, Sorry to all of you, I don't check this repository regularly, I'll update uploading parts (story/video/DM/reels) in next few weeks as a gift to all of you.

Also ReelsProcessor added in case if someone uses it. Thanks for contributing.

Regards.

ramtinak avatar Aug 23 '24 23:08 ramtinak