Skip to content

Complete the image tier outside the component #765

Description

@romain-pm

Part of #734. Three holes outside the component, each found by a real call site on Jahia/jahia.com.

  • buildImageUrl registers no cache dependency. getImageProps does. buildImageUrl is the only option for a CSS background-image, so a background image silently loses the flush an <img> gets.
  • No background mode. Add one that returns a ready url(...) value, with the same comma handling srcSet needs — a DAM URL containing a comma breaks url() the way it breaks srcSet (srcset URL rewriting corrupts candidate URLs containing commas jahia#23).
  • readImageMeta is not exported. Layout.tsx on jahia.com re-reads j:width / j:height by hand, with its own try/catch, for og:image:width and og:image:height. The library already has that function, guarded, and keeps it private.
  • No absolute URL. jahia.com hardcodes https://www.jahia.com six times for JSON-LD and reaches past the library to getAbsoluteUrl for og:image. Shared with the link side (buildNodeUrl gaps a link component cannot work around #756); land it once on buildNodeUrl and expose it on both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featA new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions