Sync image focal point (focalX/focalY) through to target#180
Draft
5PK wants to merge 1 commit into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-yresponse headers on the served image. This captures those on download and passes them through on push.Changes
fileOperations.downloadFile— resolves with the responseheaders(was{}) so callers can read image metadata.asset-utils— newextractFocalPointFromHeaders(); trusts only the CDNagility-focal-x/agility-focal-yheaders.download-assets— captures focal point from the download response and persistsfocalX/focalYonto the per-asset JSON (assets/{mediaID}.json).asset-pusher— reads the stored focal point and appendsfocalX/focalYto theasset/uploadcall (both create and update).Paired change
Requires the management-api change that accepts
focalX/focalYonasset/uploadand 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