--- android/Side9/src/dk/thoerup/side9/Side9WidgetProvider.java 2011/01/30 21:15:55 1221 +++ android/Side9/src/dk/thoerup/side9/Side9WidgetProvider.java 2011/02/08 07:32:07 1222 @@ -157,7 +157,7 @@ final String savepath = Environment.getExternalStorageDirectory() + "/Side9"; - File file = new File( savepath + "/" + data.getFilename() ); + File imageFile = new File( savepath + "/" + data.getFilename() ); /* if the picture changes later on the day we do NOT want to use an old and invalid image if (saveImage == true) { @@ -174,21 +174,24 @@ File savedir = new File(savepath); savedir.mkdirs(); - if (file.exists()) { - file.delete(); + if (imageFile.exists()) { + imageFile.delete(); } - FileOutputStream fos = new FileOutputStream(file); + FileOutputStream fos = new FileOutputStream(imageFile); fos.write(imageData); fos.close(); - File infoFile = new File( file.toString().replace(".jpg", ".txt")); + File infoFile = new File( imageFile.toString().replace(".jpg", ".txt")); if (infoFile.exists()) { infoFile.delete(); } fos = new FileOutputStream(infoFile); fos.write(data.caption.getBytes()); fos.close(); + + //save a thumb image + ImageAdapter.generateAndLoadThumb(imageFile); Intent rescan = new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory()) ); rescan.putExtra("read-only", false);