cmd/mfp-test: add raster conversion and wire image evaluation - #104
Merged
Merged
Conversation
Add notes about Ubuntu ImageMagick policy blocking PostScript coders and unsupported formats (image/vnd.cups-raster, image/jpeg+gzip) not yet handled for image evaluation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SgcYjdrNyPsMQLUGQvZpaa
…ster
- Replace ImageMagick PostScript conversion with a direct Ghostscript
call, removing the imagick dependency and Ubuntu policy.xml requirement
- Vendor cupsraster from github.com/rusq/thermoprint (MIT) into
cmd/mfp-test/cupsraster/, removing the thermoprint dependency
- Add CREDITS.txt crediting the cupsraster author and license
- Downgrade golang.org/x packages to origin/master versions, restoring
go.mod to go 1.21
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgcYjdrNyPsMQLUGQvZpaa
Add //go:embed for imgeval/enhanced_comparison.py so that image evaluation works out of the box without requiring the user to supply --comparator. NewDefaultEvaluator writes the embedded script to a temp file and sets ownedComparator so Close() cleans it up. --comparator still overrides with an external file when provided. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SgcYjdrNyPsMQLUGQvZpaa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR Adds convertToPNG() in raster.go to convert captured print documents to PNG for image evaluation:
Embeds enhanced_comparison.py into the binary via //go:embed — --comparator flag is now optional (embedded script used by default).
Wires evaluation into runner.go: captured bytes → PNG → eval.Compare.
New flags: --comparator, --quick, --timeout, --keep, --list-quick.
go.mod stays at go 1.21 (no imagick or thermoprint dependency).
go build and go vet: clean