Menu

#439 Test-suite fails with ImageMagick >=7.1.2-9

v1.0_(example)
open
None
5
2025-12-31
2025-12-19
No

With ImageMagick >=7.1.2-9 the test suite fails with

#   Failed test 'undefined'
#   at t/04_Page.t line 114.
#          got: '72'
#     expected: '300'
# Looks like you failed 1 test of 12.

I bisected ImageMagick 7.1.2-8..7.1.2-9 to commit f46647c030 (»Correct parsing of the density«), which sound totally plausible.

Unfortunately, I don't have the expertise to fix this myself, so I cannot provide a patch. But at least you should know quite well what's going on. :)

Discussion

  • Andreas Wiese

    Andreas Wiese - 2025-12-19

    Addendum: I'm trying to build gscan2pdf-2.13.5 with perl-5.40.0 on NixOS 25.11.

     

    Last edit: Andreas Wiese 2025-12-19
  • Jeffrey Ratcliffe

    Thanks for the report. Debian testing still has 7.1.2-8, so I can't reproduce this. Please try the following with 7.1.2-9 and attach the jpg to the report:

    magick -units Undefined -density 300 xc:white test.jpg

    What does the following then return?

    identify -verbose test.jpg

     
  • Andreas Wiese

    Andreas Wiese - 2025-12-20
    $ magick -version
    Version: ImageMagick 7.1.2-9 Q16-HDRI x86_64 5cff2fc4f:20251128 https://imagemagick.org
    Copyright: (C) 1999 ImageMagick Studio LLC
    License: https://imagemagick.org/script/license.php
    Features: Cipher DPC HDRI OpenMP(4.5) 
    Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype heic jng jp2 jpeg jxl lcms lqr openexr pangocairo png raqm raw rsvg tiff webp x xml zlib zstd
    Compiler: gcc (14.3)
    $ magick -units Undefined -density 300 xc:white test.jpg
    $ identify -verbose test.jpg
    Image:
      Filename: test.jpg
      Permissions: rw-r--r--
      Format: JPEG (Joint Photographic Experts Group JFIF format)
      Mime type: image/jpeg
      Class: PseudoClass
      Geometry: 1x1+0+0
      Units: Undefined
      Colorspace: Gray
      Type: Grayscale
      Base type: Undefined
      Endianness: Undefined
      Depth: 12/16-bit
      Channels: 2.0
      Channel depth:
        Gray: 16-bit
      Channel statistics:
        Pixels: 1
        Gray:
          min: 4095  (1)
          max: 4095 (1)
          mean: 4095 (1)
          median: 4095 (1)
          standard deviation: 0 (0)
          kurtosis: 0
          skewness: 0
          entropy: 0
      Colormap entries: 4096
      Colormap:
      Rendering intent: Undefined
      Gamma: 0.454545
      Matte color: grey74
      Background color: white
      Border color: srgb(223,223,223)
      Transparent color: black
      Interlace: None
      Intensity: Undefined
      Compose: Over
      Page geometry: 1x1+0+0
      Dispose: Undefined
      Iterations: 0
      Compression: JPEG
      Quality: 92
      Orientation: Undefined
      Properties:
        date:create: 2025-12-20T18:23:06+00:00
        date:modify: 2025-12-20T18:23:06+00:00
        date:timestamp: 2025-12-20T18:23:12+00:00
        jpeg:colorspace: 1
        jpeg:sampling-factor: 1x1
        signature: ea0eb021dc2ad082eb7325b55ba9a512899156fc727e9c318c8ee581965fd5b0
      Artifacts:
        verbose: true
      Tainted: False
      Filesize: 160B
      Number pixels: 1
      Pixel cache type: Memory
      Pixels per second: 4404P
      User time: 0.000u
      Elapsed time: 0:01.000
      Version: ImageMagick 7.1.2-9 Q16-HDRI x86_64 5cff2fc4f:20251128 https://imagemagick.org
    $ 
    
     
  • Jeffrey Ratcliffe

    If you compare the output of identify, whereas in previous versions, the resolution metadata was still present in the image, plus the undefined units, in this new version, the resolution is completely missing. I'm calling this a bug in Imagemagick.

     
  • Andreas Wiese

    Andreas Wiese - 2025-12-21

    Okay, so I filed a bug against ImageMagick (I hope to have gotten this right). But I'm not quite convinced here. So yes, identify doesn't report a resolution anymore, but isn't this actually correct without a unit? I mean, what does 300x300 tell without a unit?

    Edit:
    Okay, the bug report leading to the breaking commit explains this for agnostic people like me:

    From the JFIF specification:

    units: 1 byte

    • 0 = no units, X and Y specify the pixel aspect ratio
    • 1 = X and Y are dots per inch
    • 2 = X and Y are dots per cm

    When units=0, the density values are explicitly defined as aspect ratio, not resolution.

     

    Last edit: Andreas Wiese 2025-12-21
  • Jeffrey Ratcliffe

    300x300 without a unit should normally default to dots (pixels) per inch. And living in a land that uses SI units, I would be also happy for it to default to pixels per cm. But the new behaviour ends up being 72 ppi, which makes far less sense than anything else.

     
  • Jeffrey Ratcliffe

    This bug has now hit Debian sid. I'll have to skip the test in sid to avoid FTBFS. Your bug report is now seeing some attention.

     

Log in to post a comment.

MongoDB Logo MongoDB