title: Can't upload some photos to instagram by instabot
body: <p>I can't upload photos some photos to Instagram using instabot.
  Some pictures are uploaded fine and some are not. The ones I can't upload are the ones I edit using &quot;Pillow&quot;. Here is my code and after than I'll show you what I tried.</p>
  <p>My photo editing function that uses Pillow:</p>
  <pre><code>def make_square(im, min_size=1080, fill_color=(255, 255, 255)):
      #here getting the width and the height of the picture and after that adjusting it's size for it to fit on a 1080px picture perfectly
      width, height = im.size
      ratio = 1080 / width
      width = width + 0.00
      height = height + 0.00
      width = width * ratio
      height = height * ratio
      height = math.floor(height)
      width = math.floor(width)
      im = im.resize((width, height)) #resizing the picture to width 1080
      #here is some code i got online to create a white picture then paste my picture on top of it to make the picture square
      x, y = im.size
      size = max(min_size, x, y)
      new_im = Image.new('RGBA', (size, size), fill_color)
      new_im.paste(im, (int((size - x) / 2), int((size - y) / 2)))
      return new_im # returning the new image so that I can save and upload
  </code></pre>
  <p>Here is my other function to upload picture to instagram :</p>
  <pre><code>from instabot import Bot
  def UPhoto(Image, Caption):
      bot = Bot()
      bot.login(username = &quot;username&quot;, password=&quot;password&quot;)
      time.sleep(0.2)
      try:
          if bot.upload_photo(Image, caption=Caption):
              return True
          else:
              return False
      except:
          return False
  </code></pre>
  <p>when I run the upload photo I get this error:</p>
  <p>FOUND: w:1080 h:1080 r:1.0
  2020-09-12 16:00:53,680 - ERROR - Photo Upload failed with the following response: &lt;Response [400]&gt;
  2020-09-12 16:00:53,682 - INFO - Photo 'Post.png' is not uploaded.
  2020-09-12 16:00:53,683 - INFO - Total requests: 54</p>
  <p>what I tried:</p>
  <ul>
  <li>I tried to send the photo to my phone using whatsapp and Post it to instagram using my phone and it worked</li>
  <li>I tried uploading photo to whatsapp then downloading it, it downloads as jpeg, then I tried Posting it to instagram and it worked</li>
  <li>I tried changing file extension and uploading it but that didn't work</li>
  <li>I tried upload the picture as it is without editing it using Pillow and it worked for some and others not depending if the photo dimensions are acceptable by instagram or not</li>
  <li>I tried copying picture and then Posting it but that didn't work</li>
  <li>I tried editting the same picture with scikit image but that didn't work too</li>
  </ul>
  <p>Basically that's all I wish you could help, Thanks!</p>