public class ImageUtils extends Object
Copyright (c) 2011-2014 Bit Stadium GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Modifier and Type | Field and Description |
---|---|
static int |
ORIENTATION_LANDSCAPE |
static int |
ORIENTATION_PORTRAIT |
Constructor and Description |
---|
ImageUtils() |
Modifier and Type | Method and Description |
---|---|
static android.graphics.Bitmap |
decodeSampledBitmap(android.content.Context context,
android.net.Uri imageUri,
int reqWidth,
int reqHeight)
Decodes the image as a bitmap with a size as small as possible but with a minimum size of given reqWidth
and reqHeight.
|
static android.graphics.Bitmap |
decodeSampledBitmap(File file,
int reqWidth,
int reqHeight)
Decodes the image as a bitmap with a size as small as possible but with a minimum size of given reqWidth
and reqHeight.
|
static int |
determineOrientation(android.content.Context context,
android.net.Uri uri)
Determines the orientation of the image based on its ratio.
|
static int |
determineOrientation(File file)
Determines the orientation of the image based on its ratio.
|
static int |
determineOrientation(InputStream input)
Determines the orientation of the image based on its ratio.
|
public static final int ORIENTATION_PORTRAIT
public static final int ORIENTATION_LANDSCAPE
public static int determineOrientation(File file) throws IOException
file
- the file handle of the imageIOException
- if the file couldn't be processedpublic static int determineOrientation(android.content.Context context, android.net.Uri uri) throws IOException
context
- the context to useuri
- the URI of the imageIOException
- if the URI couldn't be processedpublic static int determineOrientation(InputStream input)
input
- the input stream of the imagepublic static android.graphics.Bitmap decodeSampledBitmap(File file, int reqWidth, int reqHeight) throws IOException
file
- the file handle of the imagereqWidth
- required widthreqHeight
- required heightIOException
- if the URI couldn't be processedpublic static android.graphics.Bitmap decodeSampledBitmap(android.content.Context context, android.net.Uri imageUri, int reqWidth, int reqHeight) throws IOException
context
- the context to useimageUri
- the URI of the imagereqWidth
- required widthreqHeight
- required heightIOException
- if the URI couldn't be processedCopyright © 2015. All Rights Reserved.