-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android 10 保存图片失败,android 10会将图片mime type识别成/octet-stream,导致保存失败 #183
Comments
PR is welcome! |
This issue has been fixed in the latest version(v1.6.5), but not completely: |
I verified that it worked fine on Pixel, which device are you using? |
My device is HUAWEI P20 pro (Android 10), the saved file (without .jpg extension) can be found in file system, but not invisible in system Gallery, also can't be imported in app (e.g. WeChat). if the file is appended the ".jpg", everything is solved |
How about save an image in png or gif format? @moodcal |
I have tested a gif file on my device(P20Pro), not working correctly(the saved file is treated as jpeg, no animation, but can be animated when imported in WeChat), so the format detection should be done before appending the extension. |
Yeah, that's true. It worked on Google Photos when I tested on Pixel, so I didn't add that logic. Looks like necessary now. My idea is parsing file header, but not sure if common formats have such header. BTW, PR is welcome! |
A simple solution is to use the mUri's extension directly :-) |
That's very easy to break, many social media don't have extension in their image url. |
Yeah, but it's understandable to keep the same extension as the original file |
java.lang.IllegalArgumentException: MIME type application/octet-stream cannot be inserted into content://media/external/images/media; expected MIME type under image/* |
android 10 保存图片失败,android 10会将图片mime type识别成/octet-stream,导致保存失败
![errlog](https://user-images.githubusercontent.com/12668313/68444621-58c20a80-0212-11ea-8a9f-e02c32585c30.png)
图片测试地址:https://cdn.cfesport.com//attachment/2019/11/07eba2e80aae.com/large/pgc-image/3f23c2de986540609e9846f233c3ee23?imageView2/0/h/700/q/80
The text was updated successfully, but these errors were encountered: