{"id":17215084,"url":"https://github.com/mozmorris/react-convert-image","last_synced_at":"2025-04-13T23:16:23.750Z","repository":{"id":32930299,"uuid":"145981281","full_name":"mozmorris/react-convert-image","owner":"mozmorris","description":"Convert image format in the browser.","archived":false,"fork":false,"pushed_at":"2022-12-09T09:14:52.000Z","size":2147,"stargazers_count":9,"open_issues_count":11,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T13:23:56.462Z","etag":null,"topics":["convert","format","jpeg","png","react","webp"],"latest_commit_sha":null,"homepage":"https://www.mozmorris.com/react-convert-image/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mozmorris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-24T11:05:50.000Z","updated_at":"2025-02-11T01:16:10.000Z","dependencies_parsed_at":"2023-01-14T22:43:30.752Z","dependency_job_id":null,"html_url":"https://github.com/mozmorris/react-convert-image","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozmorris%2Freact-convert-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozmorris%2Freact-convert-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozmorris%2Freact-convert-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozmorris%2Freact-convert-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mozmorris","download_url":"https://codeload.github.com/mozmorris/react-convert-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794569,"owners_count":21162615,"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":["convert","format","jpeg","png","react","webp"],"created_at":"2024-10-15T03:23:10.078Z","updated_at":"2025-04-13T23:16:23.725Z","avatar_url":"https://github.com/mozmorris.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-convert-image\n\nhttps://www.npmjs.com/package/react-convert-image\n\nReact component for image format conversion. Currently converts to WebP. Browser capability dependent.\n\nDemo: \u003ca href=\"http://www.mozmorris.com/react-convert-image\"\u003ehttp://www.mozmorris.com/react-convert-image\u003c/a\u003e\n\n## Installation\n\n```\nnpm install react-convert-image\n```\n\n## Usage\n\n```javascript\nimport React from \"react\";\nimport ConvertImage from \"react-convert-image\";\n\nclass Component extends React.Component {\n  handleConvertedImage(url) {\n    console.log(url);\n  }\n\n  render() {\n    return (\n      \u003cConvertImage\n        image=\"hello-world.jpg\"\n        onConversion={this.handleConvertedImage}\n      /\u003e\n    );\n  }\n}\n```\n\n### Props\n\n| prop              | type     | required | default  | description                                                                     |\n| ----------------- | -------- | -------- | -------- | ------------------------------------------------------------------------------- |\n| image             | string   | Yes      |          | Path to image or data URL                                                       |\n| onConversion      | function | Yes      |          | Called with base64 data URL of converted image                                  |\n| format            | string   | No       | webp     | Target image format e.g 'webp', 'jpeg', 'png'                                   |\n| quality           | number   | No       | 0.92     | A Number between 0 and 1 indicating image quality if the format is jpeg or webp |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozmorris%2Freact-convert-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmozmorris%2Freact-convert-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozmorris%2Freact-convert-image/lists"}