{"id":1470,"url":"https://github.com/kaishin/ImageScout","last_synced_at":"2025-08-06T13:32:40.995Z","repository":{"id":21754397,"uuid":"25076372","full_name":"kaishin/ImageScout","owner":"kaishin","description":"A Swift implementation of fastimage. Supports PNG, GIF, and JPEG.","archived":false,"fork":false,"pushed_at":"2019-11-30T17:33:33.000Z","size":1066,"stargazers_count":974,"open_issues_count":2,"forks_count":74,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-12-01T07:06:37.698Z","etag":null,"topics":["carthage","cocoapods","fastimage","image-processing","swift","swiftpm"],"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/kaishin.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":"2014-10-11T11:57:09.000Z","updated_at":"2024-11-02T09:27:33.000Z","dependencies_parsed_at":"2022-08-19T16:50:41.918Z","dependency_job_id":null,"html_url":"https://github.com/kaishin/ImageScout","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaishin%2FImageScout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaishin%2FImageScout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaishin%2FImageScout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaishin%2FImageScout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaishin","download_url":"https://codeload.github.com/kaishin/ImageScout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228841389,"owners_count":17980049,"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":["carthage","cocoapods","fastimage","image-processing","swift","swiftpm"],"created_at":"2024-01-05T20:15:47.189Z","updated_at":"2024-12-09T14:30:59.078Z","avatar_url":"https://github.com/kaishin.png","language":"Swift","funding_links":[],"categories":["Media","Libs","UI","Images [🔝](#readme)"],"sub_categories":["Image","Images","Other free courses"],"readme":"\u003cimg src=\"https://github.com/kaishin/ImageScout/blob/swift4/Logo.png?raw=true\" alt=\"Logo\" width=\"200\"\u003e\n\n# ImageScout\n\n![Test](https://github.com/kaishin/ImageScout/workflows/Test/badge.svg)\n[![GitHub release](https://img.shields.io/github/release/kaishin/ImageScout.svg)](https://github.com/kaishin/ImageScout/releases/latest) \n![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg) ![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS-lightgrey.svg)\n\n**ImageScout** is a Swift implementation of [fastimage](https://pypi.python.org/pypi/fastimage/0.2.1).\nIt allows you to find the size and type of a remote image by downloading as little as possible.\n\n#### Why?\n\nSometimes you need to know the size of a remote image before downloading it, such as\nusing a custom layout in a `UICollectionView`.\n\n#### How?\n\nImageScout parses the image data as it is downloaded. As soon as it finds out the size and type of image,\nit stops the download. The downloaded data is below 60 KB in most cases.\n\n#### Install\n\n#### Swift Package Manager\n\nAdd the following to your `Package.switft` file:\n\n```swift\nlet package = Package(\n    dependencies: [\n    .package(url: \"https://github.com/kaishin/ImageScout.git\", from: \"2.1.0\")\n    ],\n)\n```\n#### [Carthage](https://github.com/Carthage/Carthage)\n\n- Add the following to your Cartfile: `github \"kaishin/ImageScout\"`\n- Then run `carthage update`\n- Follow the current instructions in [Carthage's README][carthage-installation]\nfor up to date installation instructions.\n\n[carthage-installation]: https://github.com/Carthage/Carthage#adding-frameworks-to-an-application\n\n#### [CocoaPods](http://cocoapods.org)\n\n- Add the following to your [Podfile](http://guides.cocoapods.org/using/the-podfile.html): `pod 'ImageScout'`\n- You will also need to make sure you're opting into using frameworks: `use_frameworks!`\n- Then run `pod install` with CocoaPods 1.0 or newer.\n\n#### Usage\n\nThe only method you will be using is `scoutImageWithURI()`, with the following full signature:\n\n```swift\nfunc scoutImageWithURI(URI: String, completion: (NSError?, CGSize, ScoutedImageType) -\u003e ())\n```\n\nHere's an example:\n\n```swift\nlet scout = ImageScout()\n\nscout.scoutImageWithURI(\"http://.../image-scout-logo.png\") { error, size, type in\n  if let error = error {\n    print(error.code)\n  } else {\n    print(\"Size: \\(size)\")\n    print(\"Type: \\(type.rawValue)\")\n  }\n}\n```\n\nIf the image is not successfully parsed, the size is going to be `CGSizeZero` and the type `.Unsupported`. The error will contain more info about the reason:\n\n- Error code **100**: Invalid URI parameter.\n- Error code **101**: Image is corrupt or malformatted.\n- Error code **102**: Not an image or unsopported image format URL.\n\n⚠️ *It's important to keep a strong reference to the `ImageScout` instance until the callback completes. If reference is lost, your completion handler will never be executed.*\n\n#### Compatibility\n\n- Swift 5 / Xcode 11\n- iOS 8+\n- macOS 10.11\n\n#### License\n\nSee LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaishin%2FImageScout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaishin%2FImageScout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaishin%2FImageScout/lists"}