I save image from custom camera:
public String getFilename() { File file = new File(Environment.getExternalStorageDirectory().getPath(), "Products/Images"); if (!file.exists()) { file.mkdirs(); } String uriSting = (file.getAbsolutePath() + "/" + System.currentTimeMillis() + ".jpg"); return uriSting; } Now:
public String saveImage(Bitmap bitmap) { FileOutputStream out = null; String filename = getFilename(); try { out = new FileOutputStream(filename); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); } catch (FileNotFoundException e) { Log.e("Error",e.toString()); e.printStackTrace(); return ""; } return filename; } I use this filename in exifInterface after saving image
exif = new ExifInterface(filePath); But every time it shows in my log Raw image not detected, Exif: 0
file.mkdirs();Adapt your code. Check the return value of mkdirs an stop if false. Return null. Stop and display a toast to inform the user.