{
  "id": 18412839,
  "title": "A small metadata contract for reviewing photo crops",
  "url": "https://urgent.news/2026/11/06/a-small-metadata-contract-for-reviewing-photo-crops",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-06T01:09:54.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/physicsai/a-small-metadata-contract-for-reviewing-photo-crops-kkk"
  },
  "original_language": "en",
  "account": "A metadata check for photo crop handoffs is presented in this article. It does not manipulate images or decide on edits; instead, it verifies dimensions provided by a caller. The function `review_crop` takes width, height, target width, and target height as inputs and returns a dictionary with three keys: `ratio_matches`, `needs_upscale`, and `source_ratio`. The function raises a `ValueError` if the dimensions are not finite positive numbers. It checks if the aspect ratios of the source and target match and whether either dimension of the source is smaller than its corresponding target dimension. The tolerance for comparing ratios is an absolute value, not a universal image-quality threshold. The code is a standalone example and should not be integrated with any photo service. The article also includes tests for the function using Python's standard library.",
  "summary": "A photo handoff often includes a final image, an intended destination and a sentence such as “make it square.” That is not quite enough information for another person to review the export. A square file may be too small for the destination; a large file may have the wrong aspect ratio. Both checks are useful, but they answer different questions. This article builds a tiny, local metadata check…",
  "key_points": [
    "reviewcrop function checks dimensions for photo crops",
    "Returns ratio match, upscale needed, source ratio in dict",
    "Raises ValueError for non-finite positive numbers"
  ],
  "editors_take": "Automating dimension verification through a specialized metadata contract reduces manual errors in photo handoffs by ensuring aspect ratios and scaling requirements are validated before any image manipulation occurs.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}