junhoyeo / threads-api

Unofficial, Reverse-Engineered Node.js/TypeScript client for Meta's Threads. Web UI Included.
https://threads.junho.io
MIT License
1.58k stars 135 forks source link

Bad Request processing failed if image is png #111

Open Aerglonus opened 12 months ago

Aerglonus commented 12 months ago

Making a post with a PNG image it will throw the following error:

await threadsAPI.publish({
    text: '🤖 test',
    image: 'https://i.imgur.com/HyfKL15.png',
  });
# rest of response
.....
data: {
      debug_info: {
        retriable: false,
        type: 'ProcessingFailedError',
        message: 'Request processing failed'
      }
    }
SethuSenthil commented 12 months ago

Nice catch! I think we will need to convert this image to a JPG and replace the alpha layer with black by default while also allowing an option for custom colors

SethuSenthil commented 12 months ago

Does this also happen on WebP transparent images as well?

Aerglonus commented 12 months ago

Does this also happen on WebP transparent images as well?

Just did a test and yes, it also happens with WebP transparent images

[Edit] The PNG image I was sending isn't transparent, just a normal PNG image.

SethuSenthil commented 12 months ago

I'm guessing the PNG file had an alpha layer enabled, although it wasn't being utilized (having an actual transparent element)

yekayee commented 12 months ago

Failed to publish: User ID not found

junhoyeo commented 12 months ago

Nice catch! I think we will need to convert this image to a JPG and replace the alpha layer with black by default while also allowing an option for custom colors

Think this is the best approach here!