Open shansing opened 3 weeks ago
@shansing is attempting to deploy a commit to the NextChat Team on Vercel.
A member of the Team first needs to authorize it.
The compressImage
function in app/utils/chat.ts
was enhanced to handle HEIC image files more effectively. A condition was added to check if the file name ends with ".heic" in addition to checking the file type. If the file is identified as a HEIC file, it is converted to JPEG using heic2any
. Otherwise, the file is read directly as a data URL. This ensures better handling and compression of HEIC images.
File | Change Summary |
---|---|
app/utils/chat.ts |
Added condition to check if file name ends with ".heic" and logic to convert HEIC to JPEG using heic2any , or read as data URL otherwise. |
sequenceDiagram
participant User
participant App
participant heic2any
User->>App: Upload Image
App->>App: Check if file name ends with ".heic" or file type includes "heic"
alt HEIC File
App->>heic2any: Convert HEIC to JPEG
heic2any-->>App: Return JPEG Data
else Other File
App->>App: Read file as data URL
end
App-->>User: Return compressed image data
In a world of pixels bright, Where images take their flight, A rabbit hopped and said, "Let's see, Convert that HEIC to JPEG with glee!" Now your photos, light and clear, Compressed with love, bring cheer. 🐇📸
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Your build has completed!
[Preview deployment]()
Fixes .heic image uploading failure, especially on Windows.
Summary by CodeRabbit