안녕하세요.
비트맵 이미지를 파일로 저장 하는데 잘 안됩니다.
소스좀 조언 부탁 드리겠습니다.
Bitmap temp = BitmapFactory.decodeFile(원본파일.getPath());

int img_width = temp.getWidth(); // 변환할 이미지의 가로
int img_height = temp.getHeight(); // 변환할 이미지의 세로
int img_height_change = (int)((img_height*640) / img_width);

Bitmap saveBitmap = Bitmap.createScaledBitmap(temp, 640, img_height_change, true); // 이미지 리사이즈
File fileCacheItem = new File("/sdcard/");
FileOutputStream out;
try {

if(!fileCacheItem.isDirectory())
{
fileCacheItem.mkdirs();
}

out = new FileOutputStream("/sdcard/aaaaa.jpg");
saveBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);

mStrErrorMsg = "성공 .................. ";

try {
out.close();
} catch (IOException e) {
mStrErrorMsg = "실패 1";
}
} catch (FileNotFoundException e) {
mStrErrorMsg = "실패 2";
}
여기저기 검색을 해서 소스는 어느정도 정리는 되었습니다.
여기서 실행을 해보면 실패 2가 실행이 됩니다.
구글링을 해보면 메니페스트에 권한을 줘야 한다는 글도 있고...... 개념이 적어 정리가 안됩니다.
위에처럼 실행이 되면 fileCacheItem 변수로 비트맵 파일이 되는게 맞나요?
저장될 폴더와 파일명이 위의 빨간색 처럼 입력 해면 생성이 되는건지 궁금합니다.
아직은 개념이 적어서요....... 권한을 주는게 맞는건지와, 위의 소스가 잘못된 부분좀 조언 부탁 드리겠습니다.
감사합니다.