Fixed. Icons which have extensions in UpperCase, in the uploads view are not correct

This commit is contained in:
jabarros 2014-12-30 11:55:13 +01:00
parent cd1a150bf9
commit 6caad2be05
2 changed files with 2 additions and 2 deletions

View file

@ -160,7 +160,7 @@ public class LocalFileListAdapter extends BaseAdapter implements ListAdapter {
}
} else {
Uri selectedUri = Uri.fromFile(file);
String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString());
String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString().toLowerCase());
String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension);
fileIcon.setImageResource(DisplayUtils.getResourceId(mimeType, file.getName()));
}

View file

@ -181,7 +181,7 @@ public class BitmapUtils {
*/
public static boolean isImage(File file) {
Uri selectedUri = Uri.fromFile(file);
String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString());
String fileExtension = MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString().toLowerCase());
String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension);
return (mimeType != null && mimeType.startsWith("image/"));