Urgent.News

What's breaking now, across thousands of outlets.

Tech

A small metadata contract for reviewing photo crops

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…

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.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How Elon Musk's 'Universal High Income (UHI)' Works: When Humanoid Robots Push the Cost of Goods Toward Zero

Whenever Universal Basic Income (UBI) is debated, a common objection surfaces: "Even if every citizen receives an unconditional monthly stipend, won't that just trap everyone on a bare-minimum…

  • Universal High Income (UHI) replaces Universal Basic Income (UBI) in an AI/robot era.
  • AI and humanoid robots could drive goods and services costs toward zero.
  • UHI aims to fund a high income for every citizen, boosting living standards.

`npx wix release` does not build: how we shipped yesterday's `dist/` by mistake

Wix CLI, September to November 2026, measured on three of our own apps. CLI behaviour may change. npx wix release uploads whatever is in dist/ and creates a version. It doesn't run your build.

  • Dashboard bug in calendar app fixed on September 19, 2026
  • npx wix release command created version 2.17.0 without building
  • dist/ folder contained previous evening's files, not updated version

Stop Hand-Rolling JSON Lines With WriteLine. .NET 11 Writes Them for You

TL;DR: JsonSerializer.SerializeAsyncEnumerable(stream, items, topLevelValues: true) writes canonical JSON Lines: one compact value per line, LF after every one.

  • .NET 11 introduces JSONL writing with JsonSerializer.SerializeAsyncEnumerable
  • topLevelValues parameter creates JSON Lines format with newline separation
  • PipeWriter overload enables streaming JSONL endpoints in ASP.NET Core

Read, return, forget: processing passport scans without storing the image

Originally published at Read, return, forget: processing passport scans without storing the image A passport photo is the most sensitive file most apps ever receive.

  • "Read, return, forget" pattern minimizes data storage
  • Image data processed in memory, not stored long-term
  • Compliance demonstrated by showing no unnecessary image copies

Is ElevenLabs Creator Worth $22/mo? Credit Math, Cloning and When to Stay on Starter

#ad #ElevenAgentsPartner Disclosure: I'm an ElevenLabs affiliate partner. If you buy through links on my site I may earn a commission at no extra cost to you.

  • ElevenLabs Creator plan costs $22/month with 121,000 credits.
  • 60-second short video uses ~900 credits, 3-minute explainer uses ~3,510 credits.
  • Creator plan suitable for >30 min/month narration or Professional Voice Cloning.

More from Friday 6 November →