Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.