{"id":13428162,"url":"https://github.com/jkwiecien/EasyImage","last_synced_at":"2025-03-16T01:32:05.556Z","repository":{"id":46179342,"uuid":"45473310","full_name":"jkwiecien/EasyImage","owner":"jkwiecien","description":"Library for picking pictures from gallery or camera","archived":false,"fork":false,"pushed_at":"2023-03-29T12:00:26.000Z","size":399,"stargazers_count":1765,"open_issues_count":90,"forks_count":302,"subscribers_count":44,"default_branch":"master","last_synced_at":"2024-10-15T11:04:26.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jkwiecien.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-11-03T14:51:26.000Z","updated_at":"2024-10-14T02:31:24.000Z","dependencies_parsed_at":"2022-08-30T00:21:09.343Z","dependency_job_id":"9a75156a-fe62-486b-8f79-1cfa8e858077","html_url":"https://github.com/jkwiecien/EasyImage","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkwiecien%2FEasyImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkwiecien%2FEasyImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkwiecien%2FEasyImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkwiecien%2FEasyImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkwiecien","download_url":"https://codeload.github.com/jkwiecien/EasyImage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221631876,"owners_count":16855020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T01:00:47.971Z","updated_at":"2024-10-27T05:30:49.612Z","avatar_url":"https://github.com/jkwiecien.png","language":"Kotlin","funding_links":[],"categories":["Libraries","Java","Kotlin","图片"],"sub_categories":[],"readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-EasyImage-green.svg?style=true)](https://android-arsenal.com/details/1/2725) [![](https://jitpack.io/v/jkwiecien/EasyImage.svg)](https://jitpack.io/#jkwiecien/EasyImage)\n# What is it?\nEasyImage allows you to easily capture images and videos from the gallery, camera or documents without creating lots of boilerplate.\n\n# Setup\n\n## Runtime permissions\nNo additional permisions are required if you DO NOT `use setCopyImagesToPublicGalleryFolder()` setting. But if you do:\n\n### For devices running Android 10 and newer:\nNothing is required\n\n### For devices running Android 9 or lower:\nPermission need to be specified in Manifest:\n```xml\n\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n```\n\nAlso you'll need to ask for this permission in the runtime in the moment of your choice. Sample app does that.\n\n**There is also one issue about runtime permissions**. According to the docs: \n\n    If your app targets M and above and declares as using the CAMERA permission which is not granted, then attempting to use this action will result in a SecurityException.\n\nFor this reason, if your app uses `CAMERA` permission, you should check it along **with** `WRITE_EXTERNAL_STORAGE` before calling `EasyImage.openCamera()`\n\n## Gradle dependency\nGet the latest version from jitpack\n\n[![](https://jitpack.io/v/jkwiecien/EasyImage.svg)](https://jitpack.io/#jkwiecien/EasyImage)\n\n# Usage\n## Essentials\n\nCreate your EasyImageInstance like this:\n```java\nEasyImage easyImage = new EasyImage.Builder(context)\n\n// Chooser only\n// Will appear as a system chooser title, DEFAULT empty string\n//.setChooserTitle(\"Pick media\")\n// Will tell chooser that it should show documents or gallery apps\n//.setChooserType(ChooserType.CAMERA_AND_DOCUMENTS)  you can use this or the one below\n//.setChooserType(ChooserType.CAMERA_AND_GALLERY)\n// saving EasyImage state (as for now: last camera file link)\n.setMemento(memento)\n\n// Setting to true will cause taken pictures to show up in the device gallery, DEFAULT false\n.setCopyImagesToPublicGalleryFolder(false)\n// Sets the name for images stored if setCopyImagesToPublicGalleryFolder = true\n.setFolderName(\"EasyImage sample\")\n\n// Allow multiple picking\n.allowMultiple(true)\n.build();\n```\n\n### Taking image straight from camera\n- `easyImage.openCameraForImage(Activity activity,);`\n- `easyImage.openCameraForImage(Fragment fragment);`\n\n### Capturing video\n- `easyImage.openCameraForVideo(Activity activity);`\n- `easyImage.openCameraForVideo(Fragment fragment);`\n\n### Taking image from gallery or the gallery picker if there is more than 1 gallery app\n- `easyImage.openGallery(Activity activity);`\n- `easyImage.openGallery(Fragment fragment);`\n\n### Taking image from documents\n- `easyImage.openDocuments(Activity activity);`\n- `easyImage.openDocuments(Fragment fragment);`\n\n### Displaying system picker to chose from camera, documents, or gallery if no documents apps are available\n- `easyImage.openChooser(Activity activity);`\n- `easyImage.openChooser(Fragment fragment);`\n\n### Getting the photo file\n\n```java\n    protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n        super.onActivityResult(requestCode, resultCode, data);\n\n        easyImage.handleActivityResult(requestCode, resultCode, data, this, new DefaultCallback() {\n            @Override\n            public void onMediaFilesPicked(MediaFile[] imageFiles, MediaSource source) {\n                onPhotosReturned(imageFiles);\n            }\n\n            @Override\n            public void onImagePickerError(@NonNull Throwable error, @NonNull MediaSource source) {\n                //Some error handling\n                error.printStackTrace();\n            }\n\n            @Override\n            public void onCanceled(@NonNull MediaSource source) {\n                //Not necessary to remove any files manually anymore\n            }\n        });\n    }\n```\n\n# Known issues\nLibrary was pretty much rewritten from scratch in kotlin on 29.03.2019. Initial version 3.0.0 might be unstable. In case of problems fallback to version 2.1.1\nAlso version 3.0.0 is not backward compatible and will require some changes of those who used previous versions. These are not big tho. Updated readme explains it all.\n\n# License\n\n    Copyright 2015 Jacek Kwiecień.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkwiecien%2FEasyImage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkwiecien%2FEasyImage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkwiecien%2FEasyImage/lists"}