Skip to content

Sync image focal point (focalX/focalY) through to target#180

Draft
5PK wants to merge 1 commit into
mainfrom
focal-point-asset-sync
Draft

Sync image focal point (focalX/focalY) through to target#180
5PK wants to merge 1 commit into
mainfrom
focal-point-asset-sync

Conversation

@5PK

@5PK 5PK commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What & why

When syncing images we weren't carrying focal point through to the target instance. Focal point isn't returned by the Media list API — it only comes back as the CDN's agility-focal-x / agility-focal-y response headers on the served image. This captures those on download and passes them through on push.

Changes

  • fileOperations.downloadFile — resolves with the response headers (was {}) so callers can read image metadata.
  • asset-utils — new extractFocalPointFromHeaders(); trusts only the CDN agility-focal-x / agility-focal-y headers.
  • download-assets — captures focal point from the download response and persists focalX/focalY onto the per-asset JSON (assets/{mediaID}.json).
  • asset-pusher — reads the stored focal point and appends focalX/focalY to the asset/upload call (both create and update).

Paired change

Requires the management-api change that accepts focalX/focalY on asset/upload and stores them as image metadata (separate PR, Azure DevOps #2989).

Tests

Added coverage for extractFocalPointFromHeaders, buildFocalPointQuery, and the download-side focal capture. Touched test suites pass locally.

🤖 Generated with Claude Code

Focal point is not returned by the Media list API — it only comes back
as the CDN's agility-focal-x / agility-focal-y response headers on the
served image. Capture those on download and pass them through on push so
the target instance keeps the same focal point as the source.

- fileOperations.downloadFile: resolve with the response headers so
  callers can read image metadata
- asset-utils: add extractFocalPointFromHeaders (trusts only the CDN
  agility-focal-x / agility-focal-y headers)
- download-assets: capture focal point and persist it on the per-asset
  JSON (assets/{mediaID}.json)
- asset-pusher: read the stored focal point and append focalX/focalY to
  the asset/upload call (create + update)

Pairs with the management-api change that accepts focalX/focalY on
asset/upload and stores them as image metadata.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@5PK 5PK marked this pull request as draft July 14, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant