{"id":20067565,"url":"https://github.com/asaday/ezimageloader","last_synced_at":"2026-05-12T10:32:50.108Z","repository":{"id":56910255,"uuid":"65125203","full_name":"asaday/EzImageLoader","owner":"asaday","description":"Swift Image downloader","archived":false,"fork":false,"pushed_at":"2021-04-21T02:53:18.000Z","size":12416,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T23:34:26.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/asaday.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}},"created_at":"2016-08-07T09:15:23.000Z","updated_at":"2021-04-21T02:53:21.000Z","dependencies_parsed_at":"2022-08-20T19:50:35.619Z","dependency_job_id":null,"html_url":"https://github.com/asaday/EzImageLoader","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaday%2FEzImageLoader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaday%2FEzImageLoader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaday%2FEzImageLoader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaday%2FEzImageLoader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asaday","download_url":"https://codeload.github.com/asaday/EzImageLoader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241494180,"owners_count":19971871,"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-13T14:02:04.566Z","updated_at":"2026-05-12T10:32:50.069Z","avatar_url":"https://github.com/asaday.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EzImageLoader\n\nEzImageLoader is easy-to-use library for lading Images over HTTP/HTTPS. EzImageLoader is associated with [EzHTTP](https://github.com/asaday/EzHTTP).\n\n## Features\n\n- Simplest image loading\n- Just write shorter code\n- Support WebP\n- Support GIF format: of course, supporting animated GIFs\n- Extending UIImage and UIImageView\n- HTTP/HTTPS requests using EzHTTP\n\n## Requirements\n\n- iOS 9.0+\n- Xcode 11+\n\n## Installation\n\n### CocoaPods\n\nAdd EzImageLoader to the dependencies in your Podfile.\n\n```\npod 'EzImageLoader'\n```\n\nSample Podfile is [here](https://github.com/asaday/EzImageLoader/blob/master/exsample/Podfile).\n\n### Swift Package Manager\n\nYou can also install EzImageLoader using Swift Package Xcode11 later\n\nFile-\u003eSwift Packages-\u003eAdd Package Dependency...\n\n    https://github.com/asaday/EzImageLoader.git\n\n## Usage\n\nBegin by importing the EzImageLoader\n\n```\nimport EzImageLoader\n```\n\nIn addition, import [EzHTTP](https://github.com/asaday/EzHTTP) for creating URLRequest easily.\n\n```\nimport EzHTTP\n```\n\n### Basic\n\n#### GET\n\nGet for an image.\n\n```\nlet iv = UIImageView(frame: view.bounds)\nImageLoader.get(\"https://httpbin.org/image/png\") {iv.image = $0.image}\n```\n\nGet an image and resizing\n\n```\nlet mSize = CGSize(width: 200, height: 200)\nImageLoader.get(urlStr, size: mSize) {iv.image = $0.image}\n```\n\n#### URLRequest\n\nGet an image with NSURLRequest. Note that \"HTTP.createRequest()\" creates URLRequest with EzHTTP.\n\n```\nlet iv = UIImageView(frame: view.bounds)\nlet req = HTTP.createRequest(.GET, \"https://httpbin.org/image/png\", params: [:], headers: [:])\nImageLoader.request(req!) {iv.image = $0.image}\n```\n\nRequest and resize the image.\n\n```\nlet mSize = CGSize(width: 200, height: 200)\nImageLoader.request(req!, size:mSize) {iv.image = $0.image}\n```\n\n#### Result\n\nYou can get some information about a request. ResultReason is enumeration type and gives status of the result.\n\n- `$0.image` UIImage?\n- `$0.reason` enum ResultReason\n- `$0.decodeTime` TimeInterval\n- `$0.downloadTime` TimeInterval\n\n```\nlet iv = UIImageView(frame: view.bounds)\nlet mSize = CGSize(width: 300, height: 200)\nImageLoader.get(\"https://www.gstatic.com/webp/gallery/4.webp\", size: mSize) {\n    iv.image = $0.image\n    print(\"Reason\", $0.reason)\n    print(\"Decode Time\", $0.decodeTime)\n    print(\"Download Time\", $0.downloadTime)\n}\n\n// Reason downloaded\n// Decode Time 0.0499059557914734\n// Download Time 0.553457021713257\n```\n\n### Async\n\nAsync request `.requestASync()` or `.getASyinc()` for using in except main task.\n\n```\nlet req = HTTP.createRequest(.GET, \"https://httpbin.org/image/png\", params: [:], headers: [:])\nlet img1:UIImage? = ImageLoader.requestASync(req!)\n\nlet img2:UIImage? = ImageLoader.getASync(\"https://httpbin.org/image/png\")\nlet img3:UIImage? = ImageLoader.getASync(urlStr, headers: [\"Custom-Content\":\":D\"])\n```\n\n### UIImageView Extension\n\nEzImageLoader extends UIImageView. It's very simple to use.\n\n```\nlet iv = UIImageView(frame: view.bounds)\niv.loadURL(\"https://httpbin.org/image/webp\")\n\n// With additional headers\niv.loadURL(\"https://httpbin.org/image/png\", headers: [\"Custom-Content\":\"HAHAHA\"])\n\n// Apply Filter\nlet ilFilter = ImageLoader.Filter.resizer(CGSize(width: 320, height: 320))\niv.loadURL(\"https://httpbin.org/image/png\", filter: ilFilter)\n```\n\nUse with URLRequest.\n\n```\nlet iv = UIImageView(frame: view.bounds)\nlet req = HTTP.createRequest(.GET, \"https://httpbin.org/image/png\", params: [:], headers: [:])\niv.loadRequest(req!)\n\n// Apply Filter\nlet ilFilter = ImageLoader.Filter.resizer(CGSize(width: 280, height: 280))\niv.loadRequest(req!, filter: ilFilter)\n```\n\n### UIImage Extension\n\nResizing a image for UIImage.\n\n```\nlet img:UIImage = #imageLiteral(resourceName: \"SpImage\").resize(CGSize(width: 280, height: 280))\n```\n\nGet an image as Data and decode to UIImage. You can use animation GIFs and WebPs well.\n\n```\nlet gifURL = \"https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif\"\nHTTP.get(gifURL) {\n    let img = UIImage.decode($0.data!)\n    iv.image = img\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasaday%2Fezimageloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasaday%2Fezimageloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasaday%2Fezimageloader/lists"}