{"id":21371836,"url":"https://github.com/only-icesoul/react-native-cached-image","last_synced_at":"2026-05-09T03:38:44.524Z","repository":{"id":57335906,"uuid":"395849360","full_name":"Only-IceSoul/react-native-cached-image","owner":"Only-IceSoul","description":"Cached Image Android IOS","archived":false,"fork":false,"pushed_at":"2021-11-28T15:09:02.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-21T16:40:34.904Z","etag":null,"topics":["android","cached","download","fast","glide","guiso","image","imageview","ios","react-native"],"latest_commit_sha":null,"homepage":"","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/Only-IceSoul.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":"2021-08-14T01:19:58.000Z","updated_at":"2021-11-28T15:09:04.000Z","dependencies_parsed_at":"2022-09-15T15:00:30.825Z","dependency_job_id":null,"html_url":"https://github.com/Only-IceSoul/react-native-cached-image","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Only-IceSoul/react-native-cached-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Only-IceSoul%2Freact-native-cached-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Only-IceSoul%2Freact-native-cached-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Only-IceSoul%2Freact-native-cached-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Only-IceSoul%2Freact-native-cached-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Only-IceSoul","download_url":"https://codeload.github.com/Only-IceSoul/react-native-cached-image/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Only-IceSoul%2Freact-native-cached-image/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269518731,"owners_count":24430644,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","cached","download","fast","glide","guiso","image","imageview","ios","react-native"],"created_at":"2024-11-22T08:15:23.500Z","updated_at":"2026-05-09T03:38:44.485Z","avatar_url":"https://github.com/Only-IceSoul.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cached Image\n\nandroid: api 21+   \nios : 10.0+   \n\nImage is a wrapper around [Guiso](https://github.com/Only-IceSoul/Guiso) (iOS) and [Glide](https://github.com/bumptech/glide) (Android).\n\n## **Freatures**\n\n- [x] Memory cache\n- [x] Disk cache\n- [x] Resize\n- [x] uri\n- [x] Base64 String \n- [x] static Image \n- [x] Gif\n- [x] Webp image\n\n\u003cbr\u003e \n\n## Getting started\n\n`$ npm install react-native-cached-imageview --save`  \n`$ react-native link react-native-cached-imageview`  \n  \nor\n\n`$ yarn add react-native-cached-imageview `\n    \n\u003cbr\u003e\n\n## IOS\n\n**Add Swift**\n\n/ios/name_project\n\nadd a .swift file\n\n\n## **Usage**\n\n```javascript\n  import { Controller, CachedImage ,DrawableImage } from 'react-native-cached-imageview'\n\n  //(Android) DrawableImage not support Gif - useful for shared elements.\n  \n  const source = {\n      uri: 'https://unsplash.it/200/200?image=1',\n      width: 400, \n      height: 400, \n  }\n\nconst clearMemory = () =\u003e{\n    Controller.clearMemoryCache()\n}\n\n  \u003cImage source={source}  /\u003e\n\n```\n\n\n## Properties\n\n### `source?: object`\n\nSource for the remote image to load.\n\n---\n\n### `source.uri?: string`\n\nuri to load the image from. e.g. \n`https://facebook.github.io/react/img/logo_og.png`.    \n\nstatic image (\"static;${uri}\")    \n\nbase64String (\"base64,${value}\")    \n\nuri --\u003e (\"value\")  \n\n---\n\n### `source.asGif?: boolean`\n\n if the image you load is an animated GIF, Image will display a animated gif.\n Default Value -\u003e false\n\n---\n\n### `source.headers?: Object key:string `\n\nHeaders to load the image with. e.g. { Authorization: 'someAuthToken' }.\n\n---\n\n### `source.priority?: string`\n\nlow  \nnormal -\u003e Default  \nhigh  \n\nPriorities for completing loads. If more than one load is queued at a time, the load with the higher priority will end first. Priorities are considered best effort, there are no guarantees about the order in which loads will start or finish.\n\n---\n\n### `source.placeholder?: string`\n\nonly accept static image (\"static;${uri}\") and base64String (\"base64,${value}\")\n\n Default value -\u003e null\n\nImage that is shown while a request is in progress. When a request completes successfully, the placeholder is replaced with the requested resource. If the requested resource is loaded from memory, the placeholder may never be shown. If the request fails , the placeholder will continue to be displayed.\n\n---\n\n### `source.width?: number`\n\nThe width to be used in the resize, -1 ignore resize.  \n Default value -\u003e -1 \n\n---\n\n### `source.height?: number`\n\nThe height to be used in the resize, -1 ignore resize.  \n Default value -\u003e -1 \n\n---\n\n### `source.resizeMode?: string`\n\nDetermines how to resize the image:\n\ncover: Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding).\n\ncontain(Default): Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).\n\n---\n\n### `source.skipMemoryCache?: boolean`\n\n Default value -\u003e false\n\n Allows the loaded resource to skip the memory cache.  \n Note - this is not a guarantee. If a request is already pending for this resource and that request is not also skipping the memory cache, the resource will be cached in memory.\n\n---\n\n### `source.diskCacheStrategy?: string`\n\n Default value -\u003e \"automatic\"\n\nautomatic   \nnone  \nall  \ndata  \nresource  \n\n---\n\n### `scaleType?: string`\n\n Controls how the image should be displayed.\n\n Default value -\u003e \"contain\"\n\ncover   \ncontain   \n\n---\n\n### `onLoadStart?: () =\u003e void`\n\nCalled when the image starts to load.\n\n---\n\n### `onLoadSuccess?: (event) =\u003e void`\n\nCalled on a successful image fetch. Called with the width and height of the loaded image.\n\ne.g. `onLoadSuccess={e =\u003e console.log(e.nativeEvent.width, e.nativeEvent.height)}`\n\n---\n\n### `onLoadError?: (event) =\u003e void`\n\nCalled on an image fetching error.\n\ne.g. `onLoadError={e =\u003e console.log(e.nativeEvent.error)}`\n\n---\n\n### `onLoadEnd?: () =\u003e void`\n\nCalled when the image finishes loading, whether it was successful or an error.\n \n\u003cbr\u003e\n\u003cbr\u003e\n\n# Controller\n\u003cbr\u003e\n\n\n## **Clear memory cache**\nPromise\n\n```javascript\n  import { Controller } from 'react-native-cached-imageview'\n\n    Controller.clearMemoryCache()\n\n```\n\n## **Request Image**\n\nPromise\n\n```javascript\n  import { Controller } from 'react-native-cached-imageview'\n  \n  let compressFormat = \"jpeg\" | \"png\"\n  let quality = 0.9 // 0 to 1\n\n    Controller.requestImage(imageRef,compressFormat,quality).then( string64 =\u003e {\n      console.log(\"result \",string64)\n    })\n\n```\n\n\n## **Clear Cached ImageView**\n\nCancellation\n\n```javascript\n  import { Controller } from 'react-native-cached-imageview'\n  \n    Controller.clearImage(imageRef)\n\n```\n\n## **get**\n\ncallback\n\n```javascript\n  import { Controller } from 'react-native-cached-imageview'\n  \n    Controller.get( {\n      uri: 'https://unsplash.it/200/200?image=1',\n      width: 400, \n      height: 400, \n  }, (result)=\u003e{\n          \n          if(result.error != null){\n              return\n          }\n\n         console.log(\"image string \",result.image)\n    })\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonly-icesoul%2Freact-native-cached-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonly-icesoul%2Freact-native-cached-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonly-icesoul%2Freact-native-cached-image/lists"}