public class PictureFileUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
POST_AUDIO |
static java.lang.String |
POST_VIDEO |
static java.lang.String |
POSTFIX |
Modifier and Type | Method and Description |
---|---|
static java.io.File |
createCameraFile(android.content.Context context,
int type,
java.lang.String fileName,
java.lang.String format) |
static java.lang.String |
createDir(android.content.Context context,
java.lang.String filename)
创建文件夹
|
static void |
deleteAllCacheDirFile(android.content.Context context)
set empty PictureSelector Cache
|
static void |
deleteCacheDirFile(android.content.Context mContext,
int type)
set empty PictureSelector Cache
|
static java.lang.String |
extSuffix(java.io.InputStream input)
获取图片后缀
|
static java.lang.String |
getDataColumn(android.content.Context context,
android.net.Uri uri,
java.lang.String selection,
java.lang.String[] selectionArgs)
Get the value of the data column for this Uri.
|
static java.lang.String |
getDCIMCameraPath(android.content.Context ctx,
java.lang.String mimeType) |
static java.lang.String |
getDiskCacheDir(android.content.Context ctx) |
static java.lang.String |
getPath(android.content.Context context,
android.net.Uri uri)
Get a file path from a Uri.
|
static boolean |
isDownloadsDocument(android.net.Uri uri) |
static boolean |
isExternalStorageDocument(android.net.Uri uri) |
static boolean |
isGooglePhotosUri(android.net.Uri uri) |
static boolean |
isMediaDocument(android.net.Uri uri) |
static android.net.Uri |
parUri(android.content.Context context,
java.io.File cameraFile)
生成uri
|
static int |
readPictureDegree(android.content.Context context,
java.lang.String path)
读取图片属性:旋转的角度
|
static void |
rotateImage(int degree,
java.lang.String path)
判断拍照 图片是否旋转
|
static java.lang.String |
rotateImageToAndroidQ(android.content.Context context,
int degree,
java.lang.String path,
java.lang.String newFileName)
判断拍照 图片是否旋转
|
static android.graphics.Bitmap |
rotatingImageView(int angle,
android.graphics.Bitmap bitmap)
旋转Bitmap
|
static void |
saveBitmapFile(android.graphics.Bitmap bitmap,
java.io.File file) |
public static final java.lang.String POSTFIX
public static final java.lang.String POST_VIDEO
public static final java.lang.String POST_AUDIO
public static java.io.File createCameraFile(android.content.Context context, int type, java.lang.String fileName, java.lang.String format)
context
- type
- format
- public static boolean isExternalStorageDocument(android.net.Uri uri)
uri
- The Uri to check.public static boolean isDownloadsDocument(android.net.Uri uri)
uri
- The Uri to check.public static boolean isMediaDocument(android.net.Uri uri)
uri
- The Uri to check.public static boolean isGooglePhotosUri(android.net.Uri uri)
uri
- The Uri to check.public static java.lang.String getDataColumn(android.content.Context context, android.net.Uri uri, java.lang.String selection, java.lang.String[] selectionArgs)
context
- The context.uri
- The Uri to query.selection
- (Optional) Filter used in the query.selectionArgs
- (Optional) Selection arguments used in the query.public static java.lang.String getPath(android.content.Context context, android.net.Uri uri)
context
- The context.uri
- The Uri to query.public static int readPictureDegree(android.content.Context context, java.lang.String path)
path
- 图片绝对路径public static android.graphics.Bitmap rotatingImageView(int angle, android.graphics.Bitmap bitmap)
angle
- bitmap
- public static void saveBitmapFile(android.graphics.Bitmap bitmap, java.io.File file)
public static java.lang.String createDir(android.content.Context context, java.lang.String filename)
filename
- public static java.lang.String getDCIMCameraPath(android.content.Context ctx, java.lang.String mimeType)
public static void deleteCacheDirFile(android.content.Context mContext, int type)
mContext
- type
- image or video ...public static void deleteAllCacheDirFile(android.content.Context context)
context
- public static java.lang.String getDiskCacheDir(android.content.Context ctx)
ctx
- public static android.net.Uri parUri(android.content.Context context, java.io.File cameraFile)
context
- cameraFile
- public static java.lang.String extSuffix(java.io.InputStream input)
input
- public static void rotateImage(int degree, java.lang.String path)
degree
- path
- public static java.lang.String rotateImageToAndroidQ(android.content.Context context, int degree, java.lang.String path, java.lang.String newFileName)
degree
- path
-