1
0
mirror of https://github.com/wasabeef/glide-transformations.git synced 2025-10-05 18:53:20 +08:00

3 Commits
1.0.4 ... 1.0.5

Author SHA1 Message Date
wasabeef
4c23e38206 fix Transparency 2015-03-09 00:08:53 +09:00
Daichi Furiya
ffae37274c Update CHANGELOG.md 2015-02-13 16:11:43 +09:00
Daichi Furiya
0c6f696ba7 Update README.md 2015-02-13 16:07:45 +09:00
5 changed files with 17 additions and 14 deletions

View File

@@ -1,6 +1,11 @@
Change Log Change Log
========== ==========
Version 1.0.4 *(2015-02-13)*
----------------------------
Bug fix : remove original bitmap resource recycling.
Version 1.0.3 *(2015-02-05)* Version 1.0.3 *(2015-02-05)*
---------------------------- ----------------------------

View File

@@ -32,7 +32,7 @@ repositories {
} }
dependencies { dependencies {
compile 'jp.wasabeef:glide-transformations:1.0.3@aar' compile 'jp.wasabeef:glide-transformations:1.0.4@aar'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.2.3@aar' compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.2.3@aar'
} }
``` ```

View File

@@ -1,5 +1,5 @@
VERSION_NAME=1.0.4 VERSION_NAME=1.0.5
VERSION_CODE=4 VERSION_CODE=5
GROUP=jp.wasabeef GROUP=jp.wasabeef
ARTIFACT_ID=glide-transformations ARTIFACT_ID=glide-transformations

View File

@@ -43,20 +43,20 @@ public class CropCircleTransformation implements Transformation<Bitmap> {
int width = (source.getWidth() - size) / 2; int width = (source.getWidth() - size) / 2;
int height = (source.getHeight() - size) / 2; int height = (source.getHeight() - size) / 2;
Bitmap.Config config = Bitmap bitmap = mBitmapPool.get(size, size, Bitmap.Config.ARGB_8888);
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
Bitmap bitmap = mBitmapPool.get(size, size, config);
if (bitmap == null) { if (bitmap == null) {
bitmap = Bitmap.createBitmap(size, size, config); bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
} }
Canvas canvas = new Canvas(bitmap); Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint(); Paint paint = new Paint();
BitmapShader shader = new BitmapShader(source, BitmapShader.TileMode.CLAMP, BitmapShader shader = new BitmapShader(source, BitmapShader.TileMode.CLAMP,
BitmapShader.TileMode.CLAMP); BitmapShader.TileMode.CLAMP);
Matrix matrix = new Matrix(); if (width != 0 || height != 0) {
matrix.setTranslate(-width, -height); Matrix matrix = new Matrix();
shader.setLocalMatrix(matrix); matrix.setTranslate(-width, -height);
shader.setLocalMatrix(matrix);
}
paint.setShader(shader); paint.setShader(shader);
paint.setAntiAlias(true); paint.setAntiAlias(true);

View File

@@ -48,11 +48,9 @@ public class RoundedCornersTransformation implements Transformation<Bitmap> {
int width = source.getWidth(); int width = source.getWidth();
int height = source.getHeight(); int height = source.getHeight();
Bitmap.Config config = Bitmap bitmap = mBitmapPool.get(width, height, Bitmap.Config.ARGB_8888);
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;
Bitmap bitmap = mBitmapPool.get(width, height, config);
if (bitmap == null) { if (bitmap == null) {
bitmap = Bitmap.createBitmap(width, height, config); bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
} }
Canvas canvas = new Canvas(bitmap); Canvas canvas = new Canvas(bitmap);