Android: OpenCV: imwrite always returns false and fails to write

后端 未结 4 898
误落风尘
误落风尘 2020-12-09 18:06

This code used to work but on Android 4.2 and OpenCV 2.4.4 it fails, but I don\'t know why. Can anyone shed any light on it for me?

Thanks for any help.

Baz<

4条回答
  •  爱一瞬间的悲伤
    2020-12-09 18:46

    Take care with versions +4.4 (KitKat) because android.permission.WRITE_EXTERNAL_STORAGE doesn't allow to write on the external SD card:

    The WRITE_EXTERNAL_STORAGE permission must only grant write access to the primary external storage on a device. Apps must not be allowed to write to secondary external storage devices, except in their package-specific directories as allowed by synthesized permissions. Restricting writes in this way ensures the system can clean up files when applications are uninstalled.

    Take a look to: Writing to SD Card always failing

提交回复
热议问题