{"id":34751302,"url":"https://github.com/tonybart1337/image-size-stream","last_synced_at":"2025-12-25T05:19:03.854Z","repository":{"id":52662099,"uuid":"140039033","full_name":"tonybart1337/image-size-stream","owner":"tonybart1337","description":"Get image dimensions from stream","archived":false,"fork":false,"pushed_at":"2022-07-14T12:21:03.000Z","size":2283,"stargazers_count":4,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-08T20:56:39.382Z","etag":null,"topics":["buffer","dimensions","images","stream"],"latest_commit_sha":null,"homepage":null,"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/tonybart1337.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":"2018-07-06T23:51:16.000Z","updated_at":"2021-04-21T17:53:07.000Z","dependencies_parsed_at":"2022-08-25T06:43:54.181Z","dependency_job_id":null,"html_url":"https://github.com/tonybart1337/image-size-stream","commit_stats":null,"previous_names":["ashtonroute/image-size-stream"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tonybart1337/image-size-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonybart1337%2Fimage-size-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonybart1337%2Fimage-size-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonybart1337%2Fimage-size-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonybart1337%2Fimage-size-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tonybart1337","download_url":"https://codeload.github.com/tonybart1337/image-size-stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonybart1337%2Fimage-size-stream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28020360,"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-12-25T02:00:05.988Z","response_time":58,"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":["buffer","dimensions","images","stream"],"created_at":"2025-12-25T05:19:03.184Z","updated_at":"2025-12-25T05:19:03.849Z","avatar_url":"https://github.com/tonybart1337.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image-dimensions-stream\n\nA [Node](https://nodejs.org/en/) module to get dimensions of any image file stream\n\n## Supported formats\n\n* BMP\n* GIF\n* JPEG\n* PNG\n* PSD\n* DDS\n* WebP\n\n### Upcoming\n\n* SWF\n* CUR\n* ICO\n* ICNS\n* TIFF\n* SVG\n\n## Programmatic Usage\n\n```\nyarn add image-dimensions-stream\n```\n\n### Example\n\n```javascript\nconst ImageDimensionsStream = require('image-dimensions-stream');\nconst pipeline = util.promisify(require('stream').pipeline);\n\nasync function main() {\n  const sizeStream = new ImageDimensionsStream();\n  let result = {\n    mime: null,\n    dimensions: null,\n  };\n\n  sizeStream.on('mime', (mime) =\u003e {\n    console.log('mime:', mime);\n    result.mime = mime;\n  });\n\n  sizeStream.on('dimensions', (dimensions) =\u003e {\n    console.log('dimensions:', dimensions);\n    result.dimensions = dimensions;\n  });\n\n  await pipeline(fs.createReadStream('images/funny-cats.png'), sizeStream, fs.createWriteStream('/dev/null'));\n\n  return result;\n}\n\nmain().then(console.log).catch(console.error);\n```\n\n## Options\n\nKey | Type | Default | Description\n--- | --- | --- | ---\n`requireMime` | `boolean` `function` | `true` | destroy stream if mime can't be found\n`requireDimensions` | `boolean` `function` | `true` | destroy stream if dimensions can't be found\n`exif` | `boolean` `function` | `false` | use EXIF (Orientation) data if available\n`requireValidExif` | `boolean` `function` | `false` | destroy stream on invalid EXIF data otherwise just skip EXIF block. Only useful if `exif` option returns true\n`maxMimeChunkOffset` | `number` | Minimum value possible | Whether to destroy the stream if we couldn't detect mime type after reading this amount of bytes\n`maxMimeBufferSize` | `number` in bytes | 4100 | Maximum buffer size when detecting mime type\n`maxDimensionsBufferSize` | `number` in bytes | 64000 | Maximum buffer size when detecting dimensions\n\n## Credits\n\n[image-size](https://github.com/image-size/image-size) for test images and file structures\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonybart1337%2Fimage-size-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonybart1337%2Fimage-size-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonybart1337%2Fimage-size-stream/lists"}