This is a revised version of D51866 to address review comments
and resolve conflicts after D51835.
As I mentioned in D51866 [1], I would like this changes to be included in
15.0-RELEASE. I worked on D51297 to ensure that the fix for bug 280736 would
be included in the release, as there has been no progress on D45854 for over
a year. Since this is a better approach for bug 280736, it should be included
as well.
Ongoing work can be seen on GitHub:
https://github.com/metalefty/freebsd-src/commits/gif/