SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Troubleshooting Corrupted Image Downloads from Conversations Media API

Issue

Images sent via Twilio Conversations (such as two-way texting) appear blurred, degraded, or corrupted when retrieved from the Media API and stored in a backend web application or storage bucket. The original image sent from the device is clear, but the retrieved media exhibits a significant drop in quality.

 

Product

Twilio Conversations Classic

 

Resolution

Twilio Conversations performs absolutely no image processing, compression, or alteration during media upload or retrieval. Any media retrieved directly from Twilio's backend retains its original uploaded quality.

If image degradation is occurring, it is likely being introduced by backend code either before upload or after retrieval. To isolate and resolve the issue:

  1. Verify Twilio Media Integrity: Fetch the raw media details directly from Twilio using the Conversations REST API to ensure the issue is not occurring during transmission. 

curl -u "<account_sid>:<auth_token>" -G "https://mcs.us1.twilio.com/v1/Services/<chat_service_sid>/Media/<Media_SID>"
  1. Inspect the Raw Image: Use the content_direct_temporary URL provided in the API response to view the raw image exactly as it is stored on Twilio.

  2. Check Backend Image Processing: If the raw image retrieved from Twilio is clear, review the web application's image handling pipeline. Backend tools (such as the PHP GD library) often automatically process, compress, or encode images, which can leave a fingerprint on the file and degrade its quality. Ensure that no unintended compression or encoding is applied to the images during the retrieval and storage process.

 

Additional Information

Have more questions? Submit a request
Powered by Zendesk