Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No, Android Does *Not* Have a Crop Intent #8

Open
ryanhoo opened this issue Aug 21, 2015 · 0 comments
Open

No, Android Does *Not* Have a Crop Intent #8

ryanhoo opened this issue Aug 21, 2015 · 0 comments
Labels

Comments

@ryanhoo
Copy link
Owner

ryanhoo commented Aug 21, 2015

Look at this post No, Android Does Not Have a Crop Intent

Many developers are calling startActivity() on an Intent with an action of com.android.camera.action.CROP. They are doing this to crop an image.

This is a really bad idea.

Any time you find yourself typing or pasting something starting with com.android, warning bells should be sounding. Better yet, the “Lost in Space” Robot should amble toward you, waving his arms, shouting “Danger, Will Robinson! Danger!”

(note: while your name may not be Will Robinson, if a robot is flailing about in your vicinity, just play along, m’kay?)

In this specific case, this Intent action is supported by the AOSP Camera app. That app does not exist on all devices. Devices lacking this app will not respond to this undocumented Intent action, and your app will crash.

There are several open source libraries for cropping images in Android. I have not tried any of them, and therefore cannot vouch for how well any work. However, they are safer bets than relying upon an undocumented Intent action from an app that may not exist on any given user’s device.

It seems that using the so called System Crop Action: com.android.camera.action.CROPis not a wise choice.

@ryanhoo ryanhoo added question and removed question labels Jun 1, 2016
Repository owner deleted a comment Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant