{"id":15295024,"url":"https://github.com/roughsketch/imagesize","last_synced_at":"2025-04-06T02:12:35.042Z","repository":{"id":20426984,"uuid":"89887816","full_name":"Roughsketch/imagesize","owner":"Roughsketch","description":"Quickly probe the size of various image formats without reading the entire file.","archived":false,"fork":false,"pushed_at":"2023-07-14T23:59:46.000Z","size":14303,"stargazers_count":55,"open_issues_count":2,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-28T09:05:30.717Z","etag":null,"topics":["image","image-analysis","rust","rust-library"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Roughsketch.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,"governance":null}},"created_at":"2017-05-01T01:11:28.000Z","updated_at":"2024-04-09T00:21:46.000Z","dependencies_parsed_at":"2023-10-05T05:09:12.378Z","dependency_job_id":null,"html_url":"https://github.com/Roughsketch/imagesize","commit_stats":{"total_commits":166,"total_committers":11,"mean_commits":"15.090909090909092","dds":"0.24698795180722888","last_synced_commit":"6d94263451cb7472784e12840403b4113fe7ef7b"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roughsketch%2Fimagesize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roughsketch%2Fimagesize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roughsketch%2Fimagesize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Roughsketch%2Fimagesize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Roughsketch","download_url":"https://codeload.github.com/Roughsketch/imagesize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423516,"owners_count":20936626,"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":["image","image-analysis","rust","rust-library"],"created_at":"2024-09-30T17:08:20.107Z","updated_at":"2025-04-06T02:12:35.020Z","avatar_url":"https://github.com/Roughsketch.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![crates.io version]][crates.io link] [![docs-badge][]][docs]\n\n# imagesize\nQuickly probe the size of various image formats without reading the entire file.\n\nThe goal of this crate is to be able to read the dimensions of a supported image without loading unnecessary data, and without pulling in more dependencies. Most reads only require 16 bytes or less, and more complex formats take advantage of skipping junk data.\n\n## Usage\nAdd the following to your Cargo.toml:\n```toml\n[dependencies]\nimagesize = \"0.13\"\n```\n\n## Supported Image Formats\n* Aseprite\n* Avif\n* BMP\n* DDS\n* EXR\n* Farbfeld\n* GIF\n* HDR\n* HEIC / HEIF\n* ICO*\n* ILBM (IFF)\n* JPEG\n* JPEG XL\n* KTX2\n* PNG\n* PNM (PBM, PGM, PPM)\n* PSD / PSB\n* QOI\n* TGA\n* TIFF\n* VTF\n* WEBP\n\nIf you have a format you think should be added, feel free to create an issue.\n\n*ICO files can contain multiple images, `imagesize` will give the dimensions of the largest one.\n\n## Examples\n\n### From a file\n```rust\nmatch imagesize::size(\"example.webp\") {\n    Ok(size) =\u003e println!(\"Image dimensions: {}x{}\", size.width, size.height),\n    Err(why) =\u003e println!(\"Error getting dimensions: {:?}\", why)\n}\n```\n\n### From a vector\n```rust\nlet data = vec![0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x64, 0x00, 0x64, 0x00];\nmatch imagesize::blob_size(\u0026data) {\n    Ok(size) =\u003e println!(\"Image dimensions: {}x{}\", size.width, size.height),\n    Err(why) =\u003e println!(\"Error getting dimensions: {:?}\", why),\n}\n```\n\n[crates.io link]: https://crates.io/crates/imagesize\n[crates.io version]: https://img.shields.io/crates/v/imagesize.svg?style=flat-square\n[docs]: https://docs.rs/imagesize\n[docs-badge]: https://img.shields.io/badge/docs-online-5023dd.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froughsketch%2Fimagesize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froughsketch%2Fimagesize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froughsketch%2Fimagesize/lists"}