PythonMagick icon indicating copy to clipboard operation
PythonMagick copied to clipboard

Call resolutionUnits() raises `TypeError: No to_python (by-value) converter found for C++ type: MagickCore::ResolutionType`

Open carygravel opened this issue 2 years ago • 1 comments

The following code:

import subprocess
import PythonMagick
subprocess.run(["convert","-units","PixelsPerCentimeter","-density","300","xc:white","test.jpg"])
print(PythonMagick.Image("test.jpg").resolutionUnits())

produces TypeError: No to_python (by-value) converter found for C++ type: MagickCore::ResolutionType.

I would have expected a string containing PixelsPerCentimeter, or for other images PixelsPerInch or Undefined.

carygravel avatar Jun 07 '23 08:06 carygravel

Similarly, calling image.resolutionUnits("PixelsPerInch") raises:

E               Boost.Python.ArgumentError: Python argument types in
E                   Image.resolutionUnits(Image, str)
E               did not match C++ signature:
E                   resolutionUnits(Magick::Image {lvalue})
E                   resolutionUnits(Magick::Image {lvalue}, MagickCore::ResolutionType)

carygravel avatar Jun 07 '23 08:06 carygravel