Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build against & use libpng 1.5+ #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spillner
Copy link

Libpng 1.4 deprecated and libpng 1.5 finally abolished the direct access to the png_info structure that xv was using. There are a couple of other forks on GH that claim to build and work against modern libpng but some of the diffs looked a little shaky to me so I thought I'd start from scratch.

I did make some changes to the PNG comment handling, which appears to have been bugged in legacy xv (the tp pointer was not properly initialized in WritePNG if max_text was already > num_text, and the pointer was not properly advanced when adding non-keyword comments). Other than that the changes are solely what's required by the libpng changes, although it's tempting to start a wider cleanup effort. I also commented out the jasper (JPEG 2000 library) dependency in the Makefile, which lets this build on modern distributions where libjasper is not always easily available.

Built & tested against libpng 1.6.37 on Debian Bullseye (11.4), for both reading and writing.

…n libjasper. Likely fixed some longstanding bugs with PNG comment handling, which wasn't correct in the old code but was on a rarely-triggered code path. This version of xv compiles & runs on Debian Bullseye and other modern Linux/Unixes.
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.

1 participant