1. Problem Summary
When trying to upload an image saved through the X (formerly Twitter) app directly to GPT via the iPhone Photos app on an iOS (iPhone 13, iOS 17.x) environment, it was discovered that the MIME-type of the image is not recognized correctly, leading to a null
response during the Action API request, resulting in a 400 error. Despite the image format being JPEG, OpenAI's file service fails to infer the MIME type correctly.
2. Conditions for Occurrence
- Device Used: iPhone 13 (iOS 17.x)
- Upload Method: Direct upload from the Photos app to GPT
- Image Generation Path: Saved via the download button in the X app
- File Format: JPEG (based on EXIF information and compression method)
- File Extension Notation:
.jpeg
or.JPEG
(Photos app) →.jpg
(as confirmed when synced with Nextcloud on Ubuntu) - Photos App Behavior: Automatically categorizes images saved from the X app into albums
3. Summary of Experimental Results
Experimental Condition | Source | Extension | MIME Inference Value | Result |
---|---|---|---|---|
Upload X image from the Photos app | X app download | .jpeg |
null |
❌ Failed |
Copied to Files app/Nextcloud and then uploaded | Copy of X image | .jpg |
image/jpeg |
✅ Success |
Upload same image on Ubuntu | Folder synced with Nextcloud | .jpg |
image/jpeg |
✅ Success |
4. Analysis and Estimated Causes
4.1 Possibility of Metadata Interference from X App
- iOS-specific meta tags like
com.apple.metadata:kMDItemWhereFroms
may interfere with MIME-type inference
4.2 Discrepancy Between File Extension and Internal Format
- While marked as
.jpeg
on iOS, it is treated as.jpg
on platforms like Ubuntu, leading to differences in inference methods
4.3 Ignoring the MIME-type Specified by GPT
- Even if GPT specifies
image/jpeg
, OpenAI's file service ignores it and processes it asnull
5. Suggestions and Approaches
5.1 User-side Response
- Do not upload images saved from the X app directly via the Photos app
- It is recommended to transfer the image file via the Files app or PC/Mac before uploading
5.2 Request for Improvements to OpenAI and Action SDK
- Improve MIME-type inference for
.jpeg
extensions - Enhance the SDK to ensure the MIME-type specified by GPT is not ignored
- Consider Fallback processing based on Content-Sniffing without reliance on metadata
6. Available Reference Materials
The following materials can be provided upon request: - Screenshots comparing metadata in iOS Photos app and Ubuntu environment - Media property information extracted from Ubuntu - Actual request logs where the MIME-type specified by GPT was ignored
Add a New Comment