{"id":21129986,"url":"https://github.com/lkv1988/SoBitmap","last_synced_at":"2025-07-09T01:31:57.074Z","repository":{"id":29326200,"uuid":"32859776","full_name":"lkv1988/SoBitmap","owner":"lkv1988","description":"Bitmap decoder, handle resize \u0026 quality \u0026 compress stuff following user's configurations.","archived":false,"fork":false,"pushed_at":"2017-05-26T09:12:37.000Z","size":157,"stargazers_count":88,"open_issues_count":2,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-14T05:05:04.686Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://airk000.github.io/SoBitmap","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lkv1988.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-25T11:13:51.000Z","updated_at":"2023-09-18T22:59:36.000Z","dependencies_parsed_at":"2022-09-05T16:51:21.366Z","dependency_job_id":null,"html_url":"https://github.com/lkv1988/SoBitmap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lkv1988/SoBitmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkv1988%2FSoBitmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkv1988%2FSoBitmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkv1988%2FSoBitmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkv1988%2FSoBitmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lkv1988","download_url":"https://codeload.github.com/lkv1988/SoBitmap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkv1988%2FSoBitmap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264375321,"owners_count":23598359,"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-11-20T05:32:08.846Z","updated_at":"2025-07-09T01:31:56.744Z","avatar_url":"https://github.com/lkv1988.png","language":"Java","funding_links":[],"categories":["Libs"],"sub_categories":["\u003cA NAME=\"Image_Loading\"\u003e\u003c/A\u003eImage Loading"],"readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SoBitmap-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/1706)\n\n# SoBitmap\nSoBitmap is not an ImageLoader, it born for process single bitmap. Some conditions, we want a image displayed in some limit, such as the max size, the memory cost and its format. SoBitmap handle these all for you, then release you to concern the real important things. You can totally use SoBitmap as a black box, the only things you need care are the input configuration and the output bitmap.\n\n# Feature\n\n- support local file, MediaStore and network stream\n- support two config way:\n\n\t1. exact limit include max input, max output, and compress quality down step\n\t2. fuzzy limit that you only need set a level or just by default.\n- use okhttp as httpclient for downloading, I think we can trust it(Shall we have a choice about it?)\n- all callback heppen in UI thread, so relax about it\n\n# Usage\n\n### Include in your project\n\n- Gradle\n\n```groovy\nrepositories {\n    maven { url \"https://oss.sonatype.org/content/repositories/snapshots\" }\n}\n\ndependencies {\n\tcompile 'com.github.airk000:sobitmap:0.1.+'\n}\n```\n\n### Permissions\n\n```xml\n\u003c!-- if SoBitmap need to load image from network --\u003e\n\u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n\u003c!-- if your want use external storage for cache --\u003e\n\u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" /\u003e\n\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n```\n\n### Min SDK\n\nAPI9 (Android2.3)\n\n### Custom display option\n\n##### Exactly\n```java\nOptions.ExactOptionsBuilder builder = new Options.ExactOptionsBuilder();\nbuilder.step(10)\n        .format(Bitmap.CompressFormat.JPEG)\n        .maxOutput(200)\n        .maxInput(10 * 1000)\n        .maxSize(5000);\nOptions ops = builder.build();\n```\n\n##### Fuzzy\n```java\nOptions.FuzzyOptionsBuilder builder = new Options.FuzzyOptionsBuilder();\nbuilder.maxSize(5000)\n        .format(Bitmap.CompressFormat.PNG)\n        .level(Options.QualityLevel.HIGH);\nOptions ops = builder.build();\n```\n\n##### Change the default option\n```java\nSoBitmap.getInstance(context).setDefaultOption(myCustomOps);\n```\n\n### Hunting bitmap\n\n```java\nSoBitmap.getInstance(this).hunt(uri, new Callback() {\n            @Override\n            public void onHunted(Bitmap bitmap, BitmapFactory.Options options) {\n                imageView.setImageBitmap(bitmap);\n            }\n\n            @Override\n            public void onException(HuntException e) {\n                textView.setText(e.toString());\n            }\n        });\n```\n\n# *TODO*:\n\n- Multi thread speed up the decoding duration\n\n# License\n\n```\nCopyright 2016 Kevin Liu\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkv1988%2FSoBitmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flkv1988%2FSoBitmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkv1988%2FSoBitmap/lists"}