{"id":22838658,"url":"https://github.com/hkk595/resizer","last_synced_at":"2025-04-04T10:08:12.168Z","repository":{"id":144135556,"uuid":"102214118","full_name":"hkk595/Resizer","owner":"hkk595","description":"An image resizing library for Android","archived":false,"fork":false,"pushed_at":"2022-01-24T21:50:19.000Z","size":253,"stargazers_count":431,"open_issues_count":9,"forks_count":69,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-04T10:08:06.178Z","etag":null,"topics":["android","compress-images","gradle","image","image-compression","image-processing","image-scaling","mobile","mobile-app","mobile-development","photo","photo-editing","photo-editor","photo-gallery","photo-library","photo-manager","photography","resize-images","resized-images","resizing-images"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hkk595.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-02T17:56:48.000Z","updated_at":"2025-03-11T05:45:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"eeccd28c-e004-4287-9c6d-0092484f435b","html_url":"https://github.com/hkk595/Resizer","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":"0.19999999999999996","last_synced_commit":"9c779093f19d186f68e427e166da24afe8803cbb"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkk595%2FResizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkk595%2FResizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkk595%2FResizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hkk595%2FResizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hkk595","download_url":"https://codeload.github.com/hkk595/Resizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157283,"owners_count":20893220,"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":["android","compress-images","gradle","image","image-compression","image-processing","image-scaling","mobile","mobile-app","mobile-development","photo","photo-editing","photo-editor","photo-gallery","photo-library","photo-manager","photography","resize-images","resized-images","resizing-images"],"created_at":"2024-12-13T00:07:51.156Z","updated_at":"2025-04-04T10:08:12.143Z","avatar_url":"https://github.com/hkk595.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Resizer (discontinued)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Resizer-green.svg?style=flat)](https://android-arsenal.com/details/1/6155) [![](https://jitpack.io/v/hkk595/Resizer.svg)](https://jitpack.io/#hkk595/Resizer)\n\n\u003cp align=\"center\"\u003e\u003cimg width=\"50%\" height=\"auto\" src=\"https://raw.githubusercontent.com/hkk595/Resizer/master/app/src/main/res/drawable/library_logo.png\"/\u003e\u003c/p\u003e\n\nInspired by zetbaitsu's [Compressor](https://github.com/zetbaitsu/Compressor), Resizer is a lightweight and easy-to-use Android library for image scaling. It allows you to resize an image file to a smaller or bigger one while keeping the aspect ratio.\n\n#### Include Resizer into your project\n1. Add the JitPack repository to your top-level build.gradle at the end of repositories\n```groovy\nallprojects {\n    repositories {\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n2. Add the dependency in your module-level build.gradle\n```groovy\ndependencies {\n    compile 'com.github.hkk595:Resizer:v1.5'\n}\n```\n\n#### Pass in the original image file and get the resized image as a new file\n```java\nFile resizedImage = new Resizer(this)\n        .setTargetLength(1080)\n        .setQuality(80)\n        .setOutputFormat(\"JPEG\")\n        .setOutputFilename(\"resized_image\")\n        .setOutputDirPath(storagePath)\n        .setSourceImage(originalImage)\n        .getResizedFile();\n```\n#### Pass in the original image file and get the resized image as a new bitmap\n```java\nBitmap resizedImage = new Resizer(this)\n        .setTargetLength(1080)\n        .setSourceImage(originalImage)\n        .getResizedBitmap();\n```\nNote: You only need to specify the target length (in pixel) of the longer side (or either side if it's a square) of the image. Resizer will calculate the rest automatically.\n\n#### Using RxJava 2 with RxAndroid to get the resized image asynchronously\n```java\nfinal File[] resizedImage = new File[1];\nnew Resizer(this)\n        .setTargetLength(1080)\n        .setQuality(80)\n        .setOutputFormat(\"JPEG\")\n        .setOutputFilename(\"resized_image\")\n        .setOutputDirPath(storagePath)\n        .setSourceImage(originalImage)\n        .getResizedFileAsFlowable()\n        .subscribeOn(Schedulers.io())\n        .observeOn(AndroidSchedulers.mainThread())\n        .subscribe(new Consumer\u003cFile\u003e() {\n            @Override\n            public void accept(File file) {\n                resizedImage[0] = file;\n            }\n        }, new Consumer\u003cThrowable\u003e() {\n            @Override\n            public void accept(Throwable throwable) {\n                throwable.printStackTrace();\n            }\n        });\n```\n```java\nfinal Bitmap[] resizedImage = new Bitmap[1];\nnew Resizer(this)\n        .setTargetLength(1080)\n        .setSourceImage(originalImage)\n        .getResizedBitmapAsFlowable()\n        .subscribeOn(Schedulers.io())\n        .observeOn(AndroidSchedulers.mainThread())\n        .subscribe(new Consumer\u003cBitmap\u003e() {\n            @Override\n            public void accept(Bitmap bitmap) {\n                resizedImage[0] = bitmap;\n            }\n        }, new Consumer\u003cThrowable\u003e() {\n            @Override\n            public void accept(Throwable throwable) {\n                throwable.printStackTrace();\n            }\n        });\n```\nNote: You don't need to declare the new image as final nor array if it's an instance variable of the class, instead of a local variable in a function.\n\n#### Refer to the [JavaDoc](https://hkk595.github.io/Resizer) for more details.\n\n#### Library specification\n    Minimum SDK: API 16\n     \n    Default settings:\n    targetLength: 1080\n    quality: 80\n    outputFormat: JPEG\n    outputFilename: same as the source file\n    outputDirPath: the external files directory of your app\n     \n    Supported input formats:\n    BMP\n    GIF\n    JPEG\n    PNG\n    WEBP\n     \n    Supported output formats:\n    JPEG\n    PNG\n    WEBP\n     \n    Supported quality range: 0~100\n    The higher value, the better image quality but larger file size\n    PNG, which is a lossless format, will ignore the quality setting\n\n## License\n    MIT License\n     \n    Copyright (c) 2017 K.K. Ho\n     \n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n     \n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n     \n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkk595%2Fresizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhkk595%2Fresizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhkk595%2Fresizer/lists"}