public class SiliCompressor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SiliCompressor.Builder
Fluent API for creating
SiliCompressor instances. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
videoCompressionPath |
| Constructor and Description |
|---|
SiliCompressor(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
compress(int drawableID) |
java.lang.String |
compress(java.lang.String imageUri,
java.io.File destination)
Compresses the image at the specified Uri String and and return the filepath of the compressed image.
|
java.lang.String |
compress(java.lang.String imageUri,
java.io.File destination,
boolean deleteSourceImage)
Compresses the image at the specified Uri String and and return the filepath of the compressed image.
|
java.lang.String |
compressVideo(java.lang.String videoFilePath,
java.lang.String destinationDir)
Perform background video compression.
|
java.lang.String |
compressVideo(java.lang.String videoFilePath,
java.lang.String destinationDir,
int outWidth,
int outHeight,
int bitrate)
Perform background video compression.
|
java.lang.String |
compressVideo(android.net.Uri videoFileUri,
java.lang.String destinationDir)
Perform background video compression.
|
java.lang.String |
compressVideo(android.net.Uri videoFileUri,
java.lang.String destinationDir,
int outWidth,
int outHeight,
int bitrate)
Perform background video compression.
|
android.graphics.Bitmap |
getCompressBitmap(java.lang.String imageUri)
Compresses the image at the specified Uri String and and return the bitmap data of the compressed image.
|
android.graphics.Bitmap |
getCompressBitmap(java.lang.String imageUri,
boolean deleteSourceImage)
Compresses the image at the specified Uri String and and return the bitmap data of the compressed image.
|
static java.lang.String |
getRealPathFromURI_API19(android.content.Context context,
android.net.Uri uri) |
static SiliCompressor |
with(android.content.Context context) |
public static SiliCompressor with(android.content.Context context)
public java.lang.String compress(java.lang.String imageUri,
java.io.File destination)
imageUri - imageUri Uri (String) of the source image you wish to compresspublic java.lang.String compress(java.lang.String imageUri,
java.io.File destination,
boolean deleteSourceImage)
imageUri - imageUri Uri (String) of the source image you wish to compresspublic java.lang.String compress(int drawableID)
throws java.io.IOException
java.io.IOExceptionpublic android.graphics.Bitmap getCompressBitmap(java.lang.String imageUri)
throws java.io.IOException
imageUri - imageUri Uri (String) of the source image you wish to compressjava.io.IOExceptionpublic android.graphics.Bitmap getCompressBitmap(java.lang.String imageUri,
boolean deleteSourceImage)
throws java.io.IOException
imageUri - Uri (String) of the source image you wish to compressdeleteSourceImage - If True will delete the source filejava.io.IOExceptionpublic java.lang.String compressVideo(java.lang.String videoFilePath,
java.lang.String destinationDir)
throws java.net.URISyntaxException
videoFilePath - source path for the video filedestinationDir - destination directory where converted file should be savedjava.net.URISyntaxExceptionpublic java.lang.String compressVideo(android.net.Uri videoFileUri,
java.lang.String destinationDir)
throws java.net.URISyntaxException
videoFileUri - source uri for the video filedestinationDir - destination directory where converted file should be savedjava.net.URISyntaxExceptionpublic java.lang.String compressVideo(android.net.Uri videoFileUri,
java.lang.String destinationDir,
int outWidth,
int outHeight,
int bitrate)
throws java.net.URISyntaxException
videoFileUri - source uri for the video filedestinationDir - destination directory where converted file should be savedoutWidth - the target width of the compressed video or 0 to use default widthoutHeight - the target height of the compressed video or 0 to use default heightbitrate - the target bitrate of the compressed video or 0 to user default bitratejava.net.URISyntaxExceptionpublic java.lang.String compressVideo(java.lang.String videoFilePath,
java.lang.String destinationDir,
int outWidth,
int outHeight,
int bitrate)
throws java.net.URISyntaxException
videoFilePath - source path for the video filedestinationDir - destination directory where converted file should be savedoutWidth - the target width of the compressed video or 0 to use default widthoutHeight - the target height of the compressed video or 0 to use default heightbitrate - the target bitrate of the compressed video or 0 to user default bitratejava.net.URISyntaxExceptionpublic static java.lang.String getRealPathFromURI_API19(android.content.Context context,
android.net.Uri uri)