Guth
NewsDocs
Page actions
View as Markdown ↗
Explore MCP tools ↗

instrument implementation / implementation-contract

Aspect Ratio / Crop Calculator implementation

A source-bound implementation contract for Aspect Ratio / Crop Calculator; deployment and executable qualification remain separate.

Status: VERIFIED_CLEANLifecycle: implementation-contract

Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

Record owner
Guth Instruments
Lifecycle
verified-clean
Evidence ID
t5-001
Effect
Computation or source lookup only

Input and validation requirements

Zero source dimensions make the scale formula undefined, but a naive plain-JavaScript implementation could propagate Infinity or invalid fitted dimensions instead of rejecting the input. The specification does not state explicit validation behavior for zero or negative resolutions.

Required corrections

No binding erratum is attached to this unique-name record. Implementers must still preserve the declared units, domain, and failure behavior.

Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

{
  "inputs": {
    "sourceW": 1920,
    "sourceH": 1080,
    "targetW": 1920,
    "targetH": 1080,
    "units": "pixels"
  },
  "expected_outputs": {
    "scale": 1,
    "fittedWidth": 1920,
    "fittedHeight": 1080,
    "barLeft": 0,
    "barRight": 0,
    "barTop": 0,
    "barBottom": 0,
    "cropPixels": 0
  },
  "working": "scale=min(1920/1920,1080/1080)=min(1,1)=1. fittedWidth=1920*1=1920. fittedHeight=1080*1=1080. leftoverWidth=1920-1920=0, so left/right bars=0/2=0 each. leftoverHeight=1080-1080=0, so top/bottom bars=0/2=0 each. No cropping occurs, so cropPixels=0."
}

Other records

Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

  • VERIFIED_LEDGER.json
  • evidence-tranche5/tranche5-results.json