GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - CommonQ/Android-Photo-Cropper: The optimized approach to crop image from camera or gallery to appropriate scaled size images especially for large size images. This approach can help you avoid OOM exception.

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
library/AndroidImageCropper
library/AndroidImageCropper
 
 
sample/AndroidImageCropperDemo
sample/AndroidImageCropperDemo
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

AndroidPhotoCropper

he optimized approach to crop image from camera or gallery to appropriate scaled size images especially for large size images. This approach can help you avoid OOM exception

Usage

Step 1

Firstly you need instantiate a CropConfig and use CropUtils to handle the activity results for cropping images.

Step 2

Override these methods:

@Override
	public CropConfig getCropConfig() {
		return mCropParams;
	}

	@Override
	public void onImageCropped(Uri uri) {
		Log.d(TAG, "Crop Uri in path: " + uri.getPath());
		Toast.makeText(this, "Photo cropped!", Toast.LENGTH_LONG).show();
		mImageView.setImageBitmap(CropUtils.decodeUriAsBitmap(this, uri));
	}

	@Override
	public void onImageCanceled() {
		Toast.makeText(this, "Crop canceled!", Toast.LENGTH_LONG).show();
	}

	@Override
	public void onImageFailed(String message) {
		Toast.makeText(this, "Crop failed:" + message, Toast.LENGTH_LONG)
				.show();
	}

Step 3

Launch a request to crop photos.

Crop from camera

Intent intent = CropUtils.buildCaptureIntent(CropUtils.buildUri());
startActivityForResult(intent, CropUtils.REQUEST_CAMERA);

Crop from gallery

Intent intent_gallery = CropUtils.buildCropFromGalleryIntent(mCropParams);
startActivityForResult(intent_gallery, CropUtils.REQUEST_CROP);

License

Copyright 2014 CommonQ

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

The optimized approach to crop image from camera or gallery to appropriate scaled size images especially for large size images. This approach can help you avoid OOM exception.

Resources

Readme
Apache-2.0 license
Activity

Stars

118 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.