{"id":27136368,"url":"https://github.com/shubhranshu/aspect-ratio","last_synced_at":"2025-06-28T23:38:49.527Z","repository":{"id":42871351,"uuid":"256705160","full_name":"shubhranshu/aspect-ratio","owner":"shubhranshu","description":"Library to calculate aspect ratios and provide conversion between different dimensions","archived":false,"fork":false,"pushed_at":"2023-01-06T04:03:57.000Z","size":289,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T22:40:19.055Z","etag":null,"topics":["16-9","4k","aspect","aspect-ratio","device-ratio","display","fullhd","hd","ratio","screen","sd"],"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/shubhranshu.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":"2020-04-18T08:35:10.000Z","updated_at":"2021-05-12T09:22:49.000Z","dependencies_parsed_at":"2023-02-05T06:46:39.121Z","dependency_job_id":null,"html_url":"https://github.com/shubhranshu/aspect-ratio","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":"shubhranshu/nodejs-starter-template","purl":"pkg:github/shubhranshu/aspect-ratio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhranshu%2Faspect-ratio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhranshu%2Faspect-ratio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhranshu%2Faspect-ratio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhranshu%2Faspect-ratio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shubhranshu","download_url":"https://codeload.github.com/shubhranshu/aspect-ratio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhranshu%2Faspect-ratio/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262513634,"owners_count":23322663,"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":["16-9","4k","aspect","aspect-ratio","device-ratio","display","fullhd","hd","ratio","screen","sd"],"created_at":"2025-04-08T02:05:01.166Z","updated_at":"2025-06-28T23:38:49.481Z","avatar_url":"https://github.com/shubhranshu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aspect ratio\n\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/shubhranshu/aspect-ratio/Build)](https://github.com/shubhranshu/aspect-ratio/actions?query=workflow%3ABuild)\n[![GitHub issues](https://img.shields.io/github/issues/shubhranshu/aspect-ratio?style=flat)](https://github.com/shubhranshu/aspect-ratio/issues)\n[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/shubhranshu/aspect-ratio)](https://github.com/shubhranshu/aspect-ratio)\n[![npm (scoped)](https://img.shields.io/npm/v/@stubbydigits/aspect-ratio)](https://www.npmjs.com/package/@stubbydigits/aspect-ratio)\n[![npm](https://img.shields.io/npm/dt/@stubbydigits/aspect-ratio)](https://www.npmjs.com/package/@stubbydigits/aspect-ratio)\n\n[NPM Package](https://www.npmjs.com/package/@stubbydigits/aspect-ratio)\n\nCalculate aspect ratios.\n\n## Usage\n\nLibrary exports a single function `calculateRatio(x, y)` which returns the result object.\nx and y are numbers. X is always the bigger number.\n\n### Result object\n\nThe program returns an object with two properties\n\n```javascript\n  {\n    match : {},\n    sortedRatios : [],\n  }\n```\n\n- ```match``` : Calculated aspect ratio if there is an exact match\n- ```sortedRatios``` : List of aspect ratios ordered by proximity to the original dimensions\n\n#### Result format\n\nResult for both match and sortedRatios is of the following format\n\n```javascript\n{\n  name: \"19by16\", // usable name for program literals\n  ratio: \"19:16\", // Common name for the aspect ratio, if any\n  proximity : \"0.123\", // ascending numeric valu to represent closeness to the dimensions provided\n  description: \"Sometimes referred to as the Movietone ratio, this ratio was used briefly during the transitional period when the film industry was converting to sound, from 1926 to 1932 approx. It is produced by superimposing an optical soundtrack over a full-gate 1.3 aperture in printing, resulting in an almost square image. Films shot in this ratio are often projected or transferred to video incorrectly using a 1.37 mask or squashed to 1.37. Examples of films shot in the Movietone ratio include Sunrise, M, Hallelujah! and The Lighthouse.\"\n  // Description for the aspect ratio, usages and history.\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhranshu%2Faspect-ratio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubhranshu%2Faspect-ratio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhranshu%2Faspect-ratio/lists"}