1
0
mirror of https://github.com/wasabeef/glide-transformations.git synced 2025-10-04 18:03:21 +08:00

19 Commits
2.0.0 ... 2.0.2

Author SHA1 Message Date
Daichi Furiya
2a720df48d Update README.md 2017-03-17 17:47:58 -07:00
wasabeef
06db3295a1 updated art 2017-03-17 17:45:28 -07:00
Daichi Furiya
34cc92f7a4 Merge pull request #66 from wasabeef/dev
2.0.2
2017-03-17 17:41:49 -07:00
wasabeef
5715d7a999 bump up 2.0.2 2017-03-17 17:35:48 -07:00
wasabeef
36c0d00ae9 updated libs 2017-03-17 17:35:29 -07:00
wasabeef
a29346e8d2 updated sdks 2017-03-17 17:20:28 -07:00
wasabeef
c3f2ce75a4 updated gradle 2017-03-17 17:19:53 -07:00
wasabeef
4d47793f79 updated copyright 2017-03-17 17:17:37 -07:00
Daichi Furiya
45c2e3bcfe Merge pull request #45 from timusus/master
Additional resource cleanup in RSBlur
2017-03-17 15:27:20 -07:00
Tim Malseed
a139c21d31 Additional resource cleanup in RSBlur
When the blur is finished, the input, output, and blur are all destroyed, along with the renderscript instance.

This resolves a strictmode 'resource acquired but never released' violation.
2016-06-12 23:55:52 +10:00
Daichi Furiya
c3f09cdd0d Merge pull request #38 from wasabeef/v2.0.1
V2.0.1
2016-04-21 15:29:01 +09:00
wasabeef
ddd76d4f06 fix layout 2016-04-21 15:27:26 +09:00
wasabeef
f9bca8887d fix bugs issue #35 2016-04-21 15:23:22 +09:00
wasabeef
592815a6a0 update gradle 2016-04-21 15:22:58 +09:00
wasabeef
f6540b111f bump up 2.0.1 2016-04-21 15:22:46 +09:00
wasabeef
9bea464afc format 2016-04-21 15:22:21 +09:00
wasabeef
219b32bbcc format 2016-04-21 15:18:48 +09:00
Daichi Furiya
4d7190847c Merge pull request #36 from elevenfive/patch-1
Use correct field prefix
2016-04-19 13:05:36 +09:00
Matthew Zavislak
0d7a93c264 Use correct field prefix 2016-04-15 20:19:29 -07:00
33 changed files with 133 additions and 121 deletions

View File

@@ -1,6 +1,25 @@
Change Log
==========
Version 2.0.2 *(2017-03-17)*
----------------------------
Update:
- Compile & Target SDK Version 23 -> 25
- Build Tools 23.0.2 -> 25.0.2
- Support Library 23.2.1 -> 25.3.0
- GPUImage for Android 1.3.0 -> 1.4.1
Bug Fix:
- [Additional resource cleanup in RSBlur #45](https://github.com/wasabeef/glide-transformations/pull/45)
Version 2.0.1 *(2016-04-21)*
----------------------------
Fix:
[#35](https://github.com/wasabeef/glide-transformations/issues/35)
RSInvalidStateException
Version 2.0.0 *(2016-03-02)*
----------------------------

View File

@@ -29,13 +29,12 @@ Please feel free to use this.
```groovy
repositories {
jcenter()
mavenCentral() // GPUImage for Android
}
dependencies {
compile 'jp.wasabeef:glide-transformations:2.0.0'
compile 'jp.wasabeef:glide-transformations:2.0.2'
// If you want to use the GPU Filters
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0'
compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
}
```
@@ -119,7 +118,7 @@ Thanks
License
-------
Copyright 2015 Wasabeef
Copyright 2017 Wasabeef
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 MiB

After

Width:  |  Height:  |  Size: 3.9 MiB

View File

@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.novoda:bintray-release:0.3.4'
}
}

View File

@@ -1,58 +1,58 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int
versionCode "git rev-list origin/master --count".execute().text.toInteger()
versionName VERSION_NAME
}
defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int
versionCode "git rev-list origin/master --count".execute().text.toInteger()
versionName VERSION_NAME
}
signingConfigs {
release {
storeFile file(keyStoreProperty)
keyAlias keyAliasProperty
storePassword keyStorePasswordProperty
keyPassword keyAliasPasswordProperty
}
signingConfigs {
release {
storeFile file(keyStoreProperty)
keyAlias keyAliasProperty
storePassword keyStorePasswordProperty
keyPassword keyAliasPasswordProperty
}
}
buildTypes {
debug {
debuggable true
zipAlignEnabled true
}
release {
debuggable false
zipAlignEnabled true
signingConfig signingConfigs.release
}
buildTypes {
debug {
debuggable true
zipAlignEnabled true
}
release {
debuggable false
zipAlignEnabled true
signingConfig signingConfigs.release
}
}
}
def getKeyStoreProperty() {
return hasProperty('WASABEEF_KEYSTORE') ? WASABEEF_KEYSTORE : "debug.keystore"
return hasProperty('WASABEEF_KEYSTORE') ? WASABEEF_KEYSTORE : "debug.keystore"
}
def getKeyAliasProperty() {
return hasProperty('WASABEEF_KEYALIAS') ? WASABEEF_KEYALIAS : "android"
return hasProperty('WASABEEF_KEYALIAS') ? WASABEEF_KEYALIAS : "android"
}
def getKeyStorePasswordProperty() {
return hasProperty('WASABEEF_KEYSTOREPASSWORD') ? WASABEEF_KEYSTOREPASSWORD : "androiddebugkey"
return hasProperty('WASABEEF_KEYSTOREPASSWORD') ? WASABEEF_KEYSTOREPASSWORD : "androiddebugkey"
}
def getKeyAliasPasswordProperty() {
return hasProperty('WASABEEF_KEYALIASPASSWORD') ? WASABEEF_KEYALIASPASSWORD : "android"
return hasProperty('WASABEEF_KEYALIASPASSWORD') ? WASABEEF_KEYALIASPASSWORD : "android"
}
dependencies {
compile project(':transformations')
compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
compile "jp.co.cyberagent.android.gpuimage:gpuimage-library:${GPUIMAGE_VERSION}"
compile "com.android.support:appcompat-v7:${SUPPORT_PACKAGE_VERSION}"
compile "com.android.support:recyclerview-v7:${SUPPORT_PACKAGE_VERSION}"
compile project(':transformations')
compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
compile "jp.co.cyberagent.android.gpuimage:gpuimage-library:${GPUIMAGE_VERSION}"
compile "com.android.support:appcompat-v7:${SUPPORT_PACKAGE_VERSION}"
compile "com.android.support:recyclerview-v7:${SUPPORT_PACKAGE_VERSION}"
}

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.example.glide;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
>

View File

@@ -1,10 +1,10 @@
VERSION_NAME=2.0.0
VERSION_NAME=2.0.2
GROUP=jp.wasabeef
ARTIFACT_ID=glide-transformations
COMPILE_SDK_VERSION=23
BUILD_TOOLS_VERSION=23.0.2
TARGET_SDK_VERSION=23
COMPILE_SDK_VERSION=25
BUILD_TOOLS_VERSION=25.0.2
TARGET_SDK_VERSION=25
MIN_SDK_VERSION=11
POM_DESCRIPTION=which provides simple Tranformations to Glide
@@ -21,6 +21,6 @@ POM_DEVELOPER_EMAIL=dadadada.chop@gmail.com
POM_DEVELOPER_URL=wasabeef.jp
ISSUE_URL=https://github.com/wasabeef/glide-transformations/issues
SUPPORT_PACKAGE_VERSION=23.1.1
SUPPORT_PACKAGE_VERSION=25.3.0
GLIDE_VERSION=3.7.0
GPUIMAGE_VERSION=1.3.0
GPUIMAGE_VERSION=1.4.1

View File

@@ -1,7 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
#Fri Mar 17 06:53:45 JST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

View File

@@ -2,49 +2,32 @@ apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int
versionCode "git rev-list origin/master --count".execute().text.toInteger()
versionName VERSION_NAME
defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int
versionCode "git rev-list origin/master --count".execute().text.toInteger()
versionName VERSION_NAME
consumerProguardFiles 'proguard-rules.txt'
}
consumerProguardFiles 'proguard-rules.txt'
}
}
dependencies {
compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
provided "jp.co.cyberagent.android.gpuimage:gpuimage-library:${GPUIMAGE_VERSION}"
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
compile "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
provided "jp.co.cyberagent.android.gpuimage:gpuimage-library:${GPUIMAGE_VERSION}"
}
publish {
userOrg = POM_DEVELOPER_ID
groupId = GROUP
artifactId = ARTIFACT_ID
publishVersion = VERSION_NAME
desc = POM_DESCRIPTION
website = POM_URL
userOrg = POM_DEVELOPER_ID
groupId = GROUP
artifactId = ARTIFACT_ID
publishVersion = VERSION_NAME
desc = POM_DESCRIPTION
website = POM_URL
bintrayUser = BINTRAY_USER
bintrayKey = BINTRAY_API_KEY
autoPublish = false
}

View File

@@ -8,7 +8,7 @@ import android.test.ApplicationTestCase;
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
}

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -88,7 +88,7 @@ public class BlurTransformation implements Transformation<Bitmap> {
paint.setFlags(Paint.FILTER_BITMAP_FLAG);
canvas.drawBitmap(source, 0, 0, paint);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
try {
bitmap = RSBlur.blur(mContext, bitmap, mRadius);
} catch (RSRuntimeException e) {

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,13 +32,13 @@ import jp.wasabeef.glide.transformations.internal.Utils;
public class MaskTransformation implements Transformation<Bitmap> {
private static Paint mMaskingPaint = new Paint();
private static Paint sMaskingPaint = new Paint();
private Context mContext;
private BitmapPool mBitmapPool;
private int mMaskId;
static {
mMaskingPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
sMaskingPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
}
/**
@@ -73,7 +73,7 @@ public class MaskTransformation implements Transformation<Bitmap> {
Canvas canvas = new Canvas(result);
mask.setBounds(0, 0, width, height);
mask.draw(canvas);
canvas.drawBitmap(source, 0, 0, mMaskingPaint);
canvas.drawBitmap(source, 0, 0, sMaskingPaint);
return BitmapResource.obtain(result, mBitmapPool);
}

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,7 +1,7 @@
package jp.wasabeef.glide.transformations.gpu;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -3,7 +3,7 @@ package jp.wasabeef.glide.transformations.internal;
import android.graphics.Bitmap;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -11,7 +11,7 @@ import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,16 +28,19 @@ import android.renderscript.ScriptIntrinsicBlur;
public class RSBlur {
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public static Bitmap blur(Context context, Bitmap bitmap, int radius) throws RSRuntimeException {
RenderScript rs = null;
Allocation input = null;
Allocation output = null;
ScriptIntrinsicBlur blur = null;
try {
rs = RenderScript.create(context);
Allocation input =
Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
rs.setMessageHandler(new RenderScript.RSMessageHandler());
input = Allocation.createFromBitmap(rs, bitmap, Allocation.MipmapControl.MIPMAP_NONE,
Allocation.USAGE_SCRIPT);
Allocation output = Allocation.createTyped(rs, input.getType());
ScriptIntrinsicBlur blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
output = Allocation.createTyped(rs, input.getType());
blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
blur.setInput(input);
blur.setRadius(radius);
@@ -47,6 +50,15 @@ public class RSBlur {
if (rs != null) {
rs.destroy();
}
if (input != null) {
input.destroy();
}
if (output != null) {
output.destroy();
}
if (blur != null) {
blur.destroy();
}
}
return bitmap;

View File

@@ -5,7 +5,7 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
/**
* Copyright (C) 2015 Wasabeef
* Copyright (C) 2017 Wasabeef
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.