t/241_threshold.t fails since imagemagick 7.1.2-5
Brought to you by:
ra28145
This test seems to fail since imagemagick 7.1.2-5.
It was passing with imagemagick 7.1.2-3.
(note: 7.1.2-4 seems to have been retracted.)
I'm not sure whether it's an incompatibility in the libs or a regression in magick.
Gscan2pdf version 2.13.4, with Perl 5.40.0, on NixOS x86_64.
Full build and test log: https://cache.nixos.org/log/mi6mjsv5x861ki393lsy7skgm7kfaqlf-perl5.40.0-gscan2pdf-2.13.4.drv
Full list of dependencies and versions: https://hydra.nixos.org/build/309263493#tabs-build-deps
Test log snippet:
t/241_threshold.t ............................. 1/4 WARNING: The convert command is deprecated in IMv7, use "magick" instead of "convert" or "magick convert"
2025/10/10 13:18:41 Undefined units.
2025/10/10 13:18:41 The resolution and page size will probably be wrong.
t/241_threshold.t ............................. 4/4
# Failed test 'created valid PDF'
# at t/241_threshold.t line 54.
# 'Producer: PDF::Builder 3.025 [see https://github.com/PhilterPaper/Perl-PDF-Builder/blob/master/INFO/SUPPORT]
# Custom Metadata: no
# Metadata Stream: no
# Tagged: no
# UserProperties: no
# Suspects: no
# Form: none
# JavaScript: no
# Pages: 1
# Encrypted: no
# Page size: 5040 x 3312 pts
# Page rot: 0
# File size: 4550 bytes
# Optimized: no
# PDF version: 1.4
# '
# doesn't match '(?^:Page size:\s+70 x 46 pts)'
# Looks like you failed 1 test of 4.
t/241_threshold.t ............................. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests
As imagemagick 7.1.2-5 is not yet in Debian testing, I can't easily reproduce this; so please test this patch, which I hope will fix it.
Thank you for the patch.
Unfortunately, the same test failure persists with this patch and imagemagick 7.1.2-5.
Full build and test log is attached.
Thanks for the feedback. I missed a load of convert calls. Please try this new patch instead.
The test from the original post still fails.
The new patch also introduces new failures.
Build and test log attached.
Another try.
And another try.
I've successfully tested this last patch with imagemagick 7.1.2.7 from Debian sid.
Last edit: Jeffrey Ratcliffe 2025-10-28
I take it back. Must have been caching. With 7.1.2.7 from Debian sid, I can now reproduce the bug. I'll work on a fix now.
This now works for me.
Thank you!
I confirm that the latest patch solves the issue with t/241_threshold.t.
I've just noticed that I had t/3722_user_defined.t disabled.
This test contains one last call to the old "convert" command.
I also have two other failures left in:
Those two seem to be due to an OCR precision issue.
I've updated Tesseract from 3.05.02 to 5.5.0, but the failure persists.
Could this be due to a difference in default font?
We're using the open-licenced Liberation TTF for the Nix package.
Full log is attached.
I'm able to reproduce this result. To me, it looks a bit like the NixOS ImageMagick package has issues:
Running the 51_process_chain.t magick command directly:
The same command succeeds on Ubuntu 24.04.
FYI:
@pacien I'm getting:
Your system does not have Image::PNG::Libpng installed, so some PNG functions may not run correctly.errors throughout the log, even though it is in the PERL5LIB path.
If I attempt to run
gscan2pdfit complains that ImageMagick isn't available:I think that these last two failures might be subtle differences in imagemagick v6 & v7 again. I'm, travelling though so can't test my assumption.
If someone could test this updated patch. I would be grateful.
Great! This builds without error.
It still has the failure when running:
even though the log finds imagemagick:
This updated patch fixes the gscan2pdf startup message issue
Thanks! I've now built, scanned and saved a document successfully.
(including running tests t/169_import_scan.t and t/3722_user_defined.t, which were previously disabled on NixOS).
And it's on ImageMagick 7.1.2-8.
Last edit: Alistair 2025-11-02
I confirm that all tests are now passing with this latest patch.
Is a new release planned soon, or
should we go ahead and apply this patch ourselves in NixOS/nixpkgs?
I'm travelling for a week, and the machine I'm writing this from is not yet set up for releases. I'll try and get a release out ASAP, but that might not be for a week.
Gscan2pdf has been updated to 2.13.5 on nixpkgs.
Tests are passing and everything is working as expected.
Thank you!