Skip to content

feat: ask the image node for a sized URL before appending ?w= - #806

Draft
romain-pm wants to merge 1 commit into
mainfrom
feat/805-image-url-args
Draft

romain-pm wants to merge 1 commit into
mainfrom
feat/805-image-url-args

Conversation

@romain-pm

Copy link
Copy Markdown

Problem: on the default provider, getImageProps sends the size as ?w=, so a jnt:file decorator that answers node.getUrl(["w:640"]) is never asked.

Fix: resizedUrl asks node.getUrl(["w:…", "h:…"]) first and keeps that URL when it differs from node.getUrl(), otherwise it appends ?w= as before. The DAM path is unchanged.

Verified how: new cases in tests/cypress/e2e/ui/imageTest.cy.ts: a decorated stand-in gives the sized URL with no ?, and a plain stand-in gives ?w=. Locally, eslint, prettier --check and the library build (tsc, publint) pass.

The same change is owed on the feat/image-api line (#766).

Closes #805

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

🦜 Chachalog

javascript-modules minor
  • Improved <JImage> and getImageProps to use the resized URL a module returns for an image file, and to append ?w= only when none is returned.

Create a new entry online or run npx chachalog@0.5.6 prompt to create a new entry locally.

@pkg-pr-new

pkg-pr-new Bot commented Oct 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

yarn add https://pkg.pr.new/@jahia/create-module@806.tgz
yarn add https://pkg.pr.new/@jahia/javascript-modules-library@806.tgz
yarn add https://pkg.pr.new/@jahia/vite-plugin@806.tgz

commit: d49f93f

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.

JImage: ask node.getUrl(params) for a sized URL before appending ?w=

1 participant