{"id":24472923,"url":"https://github.com/shutterstock/changedpi","last_synced_at":"2025-04-05T05:02:25.460Z","repository":{"id":57196899,"uuid":"135611855","full_name":"shutterstock/changeDPI","owner":"shutterstock","description":"Javascript library that allows you to change an image's DPI settings in the browser","archived":false,"fork":false,"pushed_at":"2020-04-27T08:46:39.000Z","size":183,"stargazers_count":234,"open_issues_count":8,"forks_count":56,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T04:03:30.777Z","etag":null,"topics":["javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/shutterstock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-31T16:54:38.000Z","updated_at":"2025-03-15T21:42:29.000Z","dependencies_parsed_at":"2022-09-16T00:10:18.144Z","dependency_job_id":null,"html_url":"https://github.com/shutterstock/changeDPI","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/shutterstock%2FchangeDPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shutterstock%2FchangeDPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shutterstock%2FchangeDPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shutterstock%2FchangeDPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shutterstock","download_url":"https://codeload.github.com/shutterstock/changeDPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289408,"owners_count":20914464,"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":["javascript"],"created_at":"2025-01-21T08:14:08.917Z","updated_at":"2025-04-05T05:02:25.435Z","avatar_url":"https://github.com/shutterstock.png","language":"JavaScript","readme":"# changeDPI\n\nchangeDPI provides 2 utility functions that can change the dpi of canvas-generated image, of either dataUrl or blob formats. The functions separate the header from the image data, convert and manipulate just the header, then sticks the header back on the file. In this way, very large images can be converted quickly without having to convert the entire contents of an image file. This process is non-destructive—image data does not get modified in the process.\n\n## Install\n\nThis project depends on [node](https://nodejs.org) and [npm](https://npmjs.com).\n\n```js\nnpm install --save changedpi\n```\n\n## Usage\n\nFrom a canvas element dataUrl:\n```js\n// create the dataUrl at standard 72dpi\nvar dataUrl = canvas.toDataURL('image/jpeg', 0.92);\nvar daurl150dpi = changeDpiDataUrl(dataUrl, 150);\n```\n\nFrom a canvas element blob:\n```js\n// create the blob at standard 72dpi\ncanvas.toBlob(function(blob) {\n  changeDpiBlob(blob, 300).then(function(blob){\n    // use your changed blob\n  })\n},'image/jpeg', 0.92);\n```\n\n```js\n  TODO add example with file reader.\n```\n\n### ES6\n\nThis module uses ES6. To see a compiled ES5 version, run `npm run build` and look in `dist/`.\n\n## Testing\n\n```js\nnpm install .\nnpm run test\n```\n\n## Contribute\n\nPlease do contribute! Open an issue or submit a pull request.\n\nThe project falls under [@Shutterstock](https://github.com/shutterstock/welcome)'s [Code of Conduct](https://github.com/shutterstock/welcome/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nMIT.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshutterstock%2Fchangedpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshutterstock%2Fchangedpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshutterstock%2Fchangedpi/lists"}