Skip to content

[graf2d] Load native image helpers on demand - #23859

Draft
jmcarcell wants to merge 1 commit into
root-project:masterfrom
jmcarcell:native-image-utils-plugin
Draft

jmcarcell wants to merge 1 commit into
root-project:masterfrom
jmcarcell:native-image-utils-plugin

Conversation

@jmcarcell

@jmcarcell jmcarcell commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

This Pull request:

Changes or fixes:

🤖 Since 351f668f04e, loading the native pad painter also loads ASImageUtils and its image-format dependencies. A missing image library can therefore break ordinary batch histogram drawing. On macOS, an unresolved libgif.dylib prevents painter creation and causes hsimple to crash.

Introduce a typed TVirtualImageUtils plugin, implemented by a TASImageUtils adapter around the existing helpers. Load and cache it on the first image operation, keeping the native painter independent of the image backend while preserving the existing X11 and Cocoa implementations.

Using ROOT's plugin mechanism keeps image operations checked at compile time and avoids deprecated TImage APIs or manual runtime method lookup; fixing giflib alone would leave the unwanted dependency in place ( 👨 : this was my choice, from what I understood the plugin mechanism is what was better suited for this change).

Validation:

  • AlmaLinux 9/GCC 16: build, hsimple, batch drawing, deferred plugin loading, and existing image-to-PDF regression tests pass.
  • Batch drawing also passes with libASImageUtils.so unavailable. The batch regression was verified to fail with the original eager-link implementation.
  • Native macOS validation remains outstanding.

Checklist:

  • tested changes locally
  • updated the docs (if necessary; API comments included)

AI assistance: Codex (GPT-6) helped implement the plugin and regression tests and run validation.

cc @linev

Avoid loading the image backend when creating a native painter for
ordinary batch drawing. Resolve a typed image utility plugin on first
use instead.

Assisted-by: Codex:GPT-6
@linev

linev commented Oct 27, 2026

Copy link
Copy Markdown
Member

There is alternative solution now: #23857

@jmcarcell

Copy link
Copy Markdown
Contributor Author

I think it's not the same, #23857 handles when asimage=OFF but when asimage=ON the issue described here remains unchanged.

@linev

linev commented Oct 27, 2026

Copy link
Copy Markdown
Member

On macOS, an unresolved libgif.dylib prevents painter creation and causes hsimple to crash.

One tries to fix situation when asimage build with GIF support, but loading of such library fails. Why it happens?

@github-actions

Copy link
Copy Markdown

Test Results

    24 files      24 suites   4d 1h 54m 49s ⏱️
 3 901 tests  3 899 ✅ 0 💤 2 ❌
83 527 runs  83 519 ✅ 0 💤 8 ❌

For more details on these failures, see this check.

Results for commit 8a1723d.

This branch has not been deployed

No deployments
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.

2 participants