Skip to content

Commit

Permalink
change min sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaeyong Han committed Mar 21, 2017
1 parent 94d473a commit 577be32
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARTIFACT_ID=gpuimage-library
COMPILE_SDK_VERSION=23
BUILD_TOOLS_VERSION=23.0.2
TARGET_SDK_VERSION=23
MIN_SDK_VERSION=18
MIN_SDK_VERSION=16

POM_DESCRIPTION=Image filters for Android with OpenGL (based on GPUImage for iOS)
POM_URL=https://github.com/cyberagent/android-gpuimage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,48 +165,46 @@ private void takePicture() {
for (Camera.Size size : params.getSupportedPictureSizes()) {
Log.i("ASDF", "Supported: " + size.width + "x" + size.height);
}
mCamera.mCameraInstance.takePicture(null, null,
new Camera.PictureCallback() {
mCamera.mCameraInstance.takePicture(null, null, new Camera.PictureCallback() {

@Override
public void onPictureTaken(byte[] data, final Camera camera) {
@Override
public void onPictureTaken(byte[] data, final Camera camera) {

final File pictureFile = getOutputMediaFile(MEDIA_TYPE_IMAGE);
if (pictureFile == null) {
Log.d("ASDF",
"Error creating media file, check storage permissions");
return;
}
final File pictureFile = getOutputMediaFile(MEDIA_TYPE_IMAGE);
if (pictureFile == null) {
Log.d("ASDF",
"Error creating media file, check storage permissions");
return;
}

try {
FileOutputStream fos = new FileOutputStream(pictureFile);
fos.write(data);
fos.close();
} catch (FileNotFoundException e) {
Log.d("ASDF", "File not found: " + e.getMessage());
} catch (IOException e) {
Log.d("ASDF", "Error accessing file: " + e.getMessage());
}
try {
FileOutputStream fos = new FileOutputStream(pictureFile);
fos.write(data);
fos.close();
} catch (FileNotFoundException e) {
Log.d("ASDF", "File not found: " + e.getMessage());
} catch (IOException e) {
Log.d("ASDF", "Error accessing file: " + e.getMessage());
}

data = null;
Bitmap bitmap = BitmapFactory.decodeFile(pictureFile.getAbsolutePath());
// mGPUImage.setImage(bitmap);
final GLTextureView view = (GLTextureView) findViewById(R.id.surfaceView);
view.setRenderMode(GLTextureView.RENDERMODE_WHEN_DIRTY);
mGPUImage.saveToPictures(bitmap, "GPUImage",
System.currentTimeMillis() + ".jpg",
new OnPictureSavedListener() {

@Override
public void onPictureSaved(final Uri
uri) {
pictureFile.delete();
camera.startPreview();
view.setRenderMode(GLTextureView.RENDERMODE_CONTINUOUSLY);
}
});
}
});
data = null;
Bitmap bitmap = BitmapFactory.decodeFile(pictureFile.getAbsolutePath());
// mGPUImage.setImage(bitmap);
final GLTextureView view = (GLTextureView) findViewById(R.id.surfaceView);
view.setRenderMode(GLTextureView.RENDERMODE_WHEN_DIRTY);
mGPUImage.saveToPictures(bitmap, "GPUImage",
System.currentTimeMillis() + ".jpg",
new OnPictureSavedListener() {

@Override
public void onPictureSaved(final Uri uri) {
pictureFile.delete();
camera.startPreview();
view.setRenderMode(GLTextureView.RENDERMODE_CONTINUOUSLY);
}
});
}
});
}

public static final int MEDIA_TYPE_IMAGE = 1;
Expand Down Expand Up @@ -246,8 +244,7 @@ private static File getOutputMediaFile(final int type) {
}

private void switchFilterTo(final GPUImageFilter filter) {
if (mFilter == null
|| (filter != null && !mFilter.getClass().equals(filter.getClass()))) {
if (mFilter == null || (filter != null && !mFilter.getClass().equals(filter.getClass()))) {
mFilter = filter;

GPUImageFilterGroup filters = new GPUImageFilterGroup();
Expand Down

0 comments on commit 577be32

Please sign in to comment.