Skip to content

Fix for ImageMagick 7#14

Open
dirk-zimoch wants to merge 2 commits into
areaDetector:masterfrom
dirk-zimoch:ImageMagick7
Open

Fix for ImageMagick 7#14
dirk-zimoch wants to merge 2 commits into
areaDetector:masterfrom
dirk-zimoch:ImageMagick7

Conversation

@dirk-zimoch

@dirk-zimoch dirk-zimoch commented Jun 17, 2026

Copy link
Copy Markdown

ImageMagick 7 no longer has IntegerPixel. Instead it now defines LongPixel to have always 32 bits on all architectures. In ImageMagick 6, LongPixel had 32 or 64 bits, depending on the size of the native type long.
However, GraphicsMagic still behaves like before even in the latest version 1.4.

ImageMagick 7 no longer has `IntegerPixel`. Instead it now defines
`LongPixel` to have always 32 bits on all architectures.
In ImageMagick 6, `LongPixel` had 32 or 64 bits, depending on the
size of the native type `long`.
Comment thread urlApp/src/URLDriver.cpp Outdated
Comment on lines +123 to +127
#if MagickLibVersion >= 0x700
storageType = LongPixel;
#else
storageType = IntegerPixel;
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer a solution using <type_traits> instead of hardcoding library version numbers, but it might be less understandable, so I'm okay with this version as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<type_traits> would require a C++11 compatible compiler. Not a very high hurdle nowadays but a new requirement.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it IS a version dependent change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm definitely okay with merging this as-is.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe someone check with GraphicsMagic? I see that my ImageMagic 7.1.1 has #define MagickLibVersion 0x711 while GraphicsMagick 1.3.45 has #define MagickLibVersion 0x282502. Different format.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GraphicsMagic 1.3.45 still has IntegerPixel and defines this enum:

typedef enum
{
  CharPixel,         /* Unsigned 8 bit 'unsigned char' */
  ShortPixel,        /* Unsigned 16 bit 'unsigned short int' */
  IntegerPixel,      /* Unsigned 32 bit 'unsigned int' */
  LongPixel,         /* Unsigned 32 or 64 bit (CPU dependent) 'unsigned long' */
  FloatPixel,        /* Floating point 32-bit 'float' */
  DoublePixel        /* Floating point 64-bit 'double' */
} StorageType;

So in GraphicsMagic 1.3.45, we still need IntegerPixel for 32 bit pixels.
I need to change the MagickLibVersion test.

@dirk-zimoch dirk-zimoch requested a review from ericonr July 7, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants