Skip to content

[graf2d] Make libjpeg a builtin obtained from the web and remove the vendored code#21556

Merged
dpiparo merged 4 commits intoroot-project:masterfrom
dpiparo:builtin_libjpeg_v2
Mar 11, 2026
Merged

[graf2d] Make libjpeg a builtin obtained from the web and remove the vendored code#21556
dpiparo merged 4 commits intoroot-project:masterfrom
dpiparo:builtin_libjpeg_v2

Conversation

@dpiparo
Copy link
Member

@dpiparo dpiparo commented Mar 10, 2026

This PR accomplishes these steps:

  • Adds libjpeg as a builtin, taking the source tarball from the web (for the moment from the root.cern website, waiting for the update of the lcgpackages one)
  • Removes the vendored libjpeg
  • Provides all the CMake infrastructure to build the newly provided builtin
  • Tests the production of a simple jpeg (and png and gif) images

Thanks to @hageboeck and @bellenot for all their help in crafting this changes!

this change simply add the new code, while the previous mechanism, i.e.
the vendoring of libjpeg, is still used.
@dpiparo dpiparo requested review from bellenot and hageboeck March 10, 2026 13:43
@dpiparo dpiparo self-assigned this Mar 10, 2026
@dpiparo dpiparo requested a review from couet as a code owner March 10, 2026 13:43
Copy link
Collaborator

@ferdymercury ferdymercury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, thanks!

In the future, is there a plan to follow the same path with libpng ?

One unrelated question: I see there are two different zlib builtin versions hard-coded in the repo, once in graf2d/asimage/src/libAfterImage/zlib and once in builtins/zlib/
Is that a historical artefact or is it on purpose?

@dpiparo
Copy link
Member Author

dpiparo commented Mar 10, 2026

Hi @ferdymercury ! Yes of course! And more simplifications are planned, and I suspect we'll be able to provide even more as we continue to work on this problem

Copy link
Member

@hageboeck hageboeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great to see this coming up, but I have a few questions. 🙂

Comment on lines +17 to +19
for (auto &&fileName : fileNames) {
c.SaveAs(fileName.c_str());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it test that the images are written correctly? Is ROOT issuing a TError, so a problem would be detected?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the answer is no, one could check that the files size exceeds a value to be determined by trial and error.
I also would prefer having a canvas that's not completely empty. Could we e.g. put a title box or a histogram on it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the answer to the first question is yes. And yes, we could have a title and a histo, no doubt about that.

Copy link
Member

@bellenot bellenot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot!

@dpiparo
Copy link
Member Author

dpiparo commented Mar 10, 2026

LGTM, thanks a lot!

thank you for the guidance!

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

Test Results

    23 files      23 suites   3d 6h 33m 33s ⏱️
 3 820 tests  3 818 ✅ 1 💤 1 ❌
80 252 runs  80 242 ✅ 9 💤 1 ❌

For more details on these failures, see this check.

Results for commit ea5d185.

♻️ This comment has been updated with latest results.

@dpiparo dpiparo force-pushed the builtin_libjpeg_v2 branch from 263956a to 13b3c7e Compare March 10, 2026 16:18
@dpiparo
Copy link
Member Author

dpiparo commented Mar 10, 2026

All comments addressed and also corrected a typo in the name of the prefix directory (that would not have had any impact on users, but still)

@dpiparo dpiparo force-pushed the builtin_libjpeg_v2 branch from 65c2670 to ea5d185 Compare March 10, 2026 19:31
@dpiparo
Copy link
Member Author

dpiparo commented Mar 10, 2026

the gif generation has been put aside because of #21561 .

@dpiparo dpiparo merged commit d6dbb52 into root-project:master Mar 11, 2026
28 of 31 checks passed
@dpiparo dpiparo deleted the builtin_libjpeg_v2 branch March 11, 2026 05:29
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.

4 participants