Question Details

Answered
Message API and Image file JPEG format conversion

Hi, I'm currently trying to make a chatbot which helps users send image to my chatbot backend and do further image processing. My case is that I need the image content to not be tampered in anyway. Everything works fine except for the case that if I send a PNG image, I always got a JPEG version of it in message content which the image content (in bytes) is completely different from the original.

For example, if I setup a simlpe echo bot and I send a cat.png to the bot then if I retrieve the image by requesting from: https://api.line.me/v2/bot/message/{{messageID}}/content I will get a cat.jpeg back

Is there anyway for me to retrieve the original cat.png ?

0
Edited: 6 months ago
Profile picture
Tuan Nguyen

Answers

1
Profile picture
Shoya
Posted: 6 months ago

It seems difficult. But I have two alternative ideas.

  1. convert jpeg to png on your bot server.
  2. image upload via LIFF. (you can get original image).

I hope you will find it useful. thanks.

Are you sure? question.vm