What are the requirements for thumbnails in image messages?

Format and size requirements

Format: Image messages include a JPG thumbnail, followed by Base64 encoding.

Size: After Base64 encoding, aim for 5k, with a max of 80k. Note: After encoding, remove all \r\n, \r, and \n.

How to generate thumbnails

  1. Check the width or height of the original image. Compress if either side exceeds 240px.

  2. Scale the image proportionally, keeping the longest side at 240px and the shortest at 100px.

  3. Compress the image to 30% of its original size to meet the recommended size.