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)
Compress drawable file with specified drawableID
|
java.lang.String |
compress(java.lang.String uriString,
java.io.File destination)
Compress the image at with the specified path and return the filepath of the compressed image.
|
java.lang.String |
compress(java.lang.String uriString,
java.io.File destination,
boolean deleteSourceImage)
Compress the image at with the specified path 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 videoContentUri,
java.lang.String destinationDir)
This method compresses the video using the content uri of the video
|
java.lang.String |
compressVideo(android.net.Uri videoContentUri,
java.lang.String destinationDir,
int outWidth,
int outHeight,
int bitrate)
This method compresses the video using the content uri of the video
|
protected static java.lang.String |
getAuthorities(android.content.Context context) |
android.graphics.Bitmap |
getCompressBitmap(java.lang.String imagePath)
Compress the image at with the specified path and return the bitmap data of the compressed image.
|
android.graphics.Bitmap |
getCompressBitmap(java.lang.String imageUri,
boolean deleteSourceImage)
Compress the image at with the specified path and return the bitmap data of the compressed image.
|
static SiliCompressor |
with(android.content.Context context) |
public static SiliCompressor with(android.content.Context context)
public java.lang.String compress(java.lang.String uriString,
java.io.File destination)
uriString - The uriString of the image file you wish to compress.destination - The destination directory where the compressed image will be stored.protected static java.lang.String getAuthorities(android.content.Context context)
public android.graphics.Bitmap getCompressBitmap(java.lang.String imagePath)
throws java.io.IOException
imagePath - The path of the image file you wish to compressjava.io.IOExceptionpublic java.lang.String compress(java.lang.String uriString,
java.io.File destination,
boolean deleteSourceImage)
uriString - The uriString of the image file you wish to compress.destination - The destination directory where the compressed image will be stored.deleteSourceImage - if True will delete the original filepublic android.graphics.Bitmap getCompressBitmap(java.lang.String imageUri,
boolean deleteSourceImage)
throws java.io.IOException
imageUri - The String uri of the image file you wish to compress.deleteSourceImage - 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 videoContentUri,
java.lang.String destinationDir)
throws java.net.URISyntaxException
videoContentUri - destinationDir - destination directory where converted file should be savedjava.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 java.lang.String compressVideo(android.net.Uri videoContentUri,
java.lang.String destinationDir,
int outWidth,
int outHeight,
int bitrate)
throws java.net.URISyntaxException
videoContentUri - destinationDir - 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 compress(int drawableID)
drawableID - ID of the drawable file to compressjava.io.IOException