Skip to content

feat(dynjandi): add Dynjandi image CDN provider - #201

Open
baldurpan wants to merge 3 commits into
ascorbic:mainfrom
baldurpan:feature/dynjandi-provider
Open

baldurpan wants to merge 3 commits into
ascorbic:mainfrom
baldurpan:feature/dynjandi-provider

Conversation

@baldurpan

@baldurpan baldurpan commented Oct 4, 2026 •

Copy link
Copy Markdown

Adds Dynjandi as an image CDN provider. Dynjandi is a hosted image CDN, currently in a free, invitation-only beta, with paid plans after the beta. Its spec and SDK are open source at dynjandi-dev/dynjandi.

URL shape

Dynjandi serves an uploaded image at /<id> and a variant at /<id>/ followed by a chain of -/<operation>/<arguments>/ segments, applied in order:

https://cdn.dynjandi.dev/a2451228-dfce-4e9f-9d18-5929175cb233/-/resize/800x450/-/format/webp/-/quality/80/

The grammar is specified in the project's OpenAPI spec (the "Variant URL grammar" section).

Operations

  • width and height map to resize/<w>x<h>/, either side optional. With both, the service scales to cover and centre-crops, which is the default fit unpic asks for.
  • format maps to format/<f>/ for jpeg, png, webp and avif. jpg is sent as jpeg.
  • quality maps to quality/<q>/: an integer from 1 to 100, or one of the service's named levels (lightest, lighter, normal, smart, better, best).
  • crop is provider-specific and carries the grammar's <w>x<h>/<position> text (compass, attention, entropy, face chains, or focal/<x>x<y>). scale_crop is read as crop. extract reads crops back, so transform of an already-cropped URL keeps the crop.
  • Operations are emitted in a fixed order: crop, resize, format, quality.

The service answers any operation it doesn't support with a 400, so anything without a Dynjandi equivalent is dropped, never sent. That includes out-of-range or non-integer sizes, unsupported formats and unknown quality values.

Defaults and caveats

  • No default format. The service doesn't negotiate format from Accept, and format/auto is a 400, so when no format is given the original format is served.
  • Upscaling. The service upscales when asked for more pixels than the source has, and the provider can't know the source size from the URL. This departs from the "never upscale" guideline in CONTRIBUTING.md. It is documented in the provider's header comment.

Detection

cdn.dynjandi.dev is added to data/domains.json. Custom domains aren't detected and need provider: "dynjandi".

Checks

  • deno check src/ is clean, and deno test -A src/ passes (88 tests, 314 steps). deno fmt --check is clean on every touched file except deno.jsonc, which already lacks a final newline on main. deno publish --dry-run passes.
  • e2e.test.ts: both Dynjandi steps pass against production with the demo image, a CC0 photo of the Dynjandi waterfall. Six other steps (Cloudflare ×2, IPX ×2, Next.js, Vercel) fail the same way on the base commit without this change.
  • 4031 URLs from generate were parsed with the service's own grammar package (@dynjandi/transform-grammar). They cover a matrix of every operation, alone and combined, at boundary values. URLs built by the Dynjandi SDK extract back to the same width, height, format, quality and crop.
  • A srcset built by @unpic/core with this provider loads at every width (640w to 1600w).

CI

  • Deno test: everything up to the e2e step passes. The e2e step fails on the six steps above, the same ones that fail on main (red since January) and on feat(imagor): add imagor provider #196.
  • Format: its auto-commit step can't push to a fork branch, so it fails on every fork PR. deno fmt src leaves every file this PR touches unchanged. The only file it would reformat is src/providers/cloudflare.ts (one whitespace-only line, already on main).

Adds extract, generate and transform for Dynjandi image URLs
(https://cdn.dynjandi.dev). Supports resize, crop, format and quality, and
drops anything the service would reject. Wire-up follows separately.
@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d278a46

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
unpic Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@baldurpan
baldurpan marked this pull request as draft October 4, 2026 22:09
@baldurpan
baldurpan marked this pull request as ready for review November 4, 2026 00:36
@baldurpan

Copy link
Copy Markdown
Author

Hi @ascorbic, this is ready for review whenever you have a moment. Could you approve the workflow runs? The previous ones expired after 30 days waiting for approval.

The description covers what to expect from CI. The only failures should be the six e2e steps that already fail on main (Cloudflare ×2, IPX ×2, Next.js, Vercel), and Format, which fails on every fork PR. Happy to change anything.

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