### ImageMagick version

7.1.1.22 built from source (8fccfab)

### Operating system

Linux

### Operating system, version and so on

Fedora 38

### Description

This is related to #6811 .

I am still trying to read the pixel data / indices a paletted image:
![new_height](https://github.com/ImageMagick/ImageMagick/assets/1310747/c33f4a16-421b-452c-a71a-38ba44f146f7)

But get the Magick::ErrorOption Exception "Magick: Unable to retrieve meta content." on calling getConstMetacontent().

In ImageMagick 6 / Magick++ the function to get indexed pixel data was called getConstIndexes(), but it does not exist anymore. From the docs [here](https://www.imagemagick.org/Magick++/Image++.html) I'm grasping that my minimal example below should read the pixels / indices fine.

### Steps to Reproduce

Minimal example:

**imtest.cpp:**

```c++
#include <iostream>

#include <Magick++.h>

int main(int argc, const char *argv[])
{
    std::cout << "Reading " << argv[1];
    Magick::Image img;
    try
    {
        img.read(argv[1]);
    }
    catch (const Magick::Exception &ex)
    {
        throw std::runtime_error("Failed to read image");
    }
    auto imgSize = img.size();
    std::cout << " -> " << imgSize.width() << "x" << imgSize.height() << ", ";
    if (img.classType() == Magick::ClassType::PseudoClass && img.type() == Magick::ImageType::PaletteType)
    {
        std::vector<uint8_t> data;
        std::cout << "paletted, " << img.colorMapSize() << " colors" << std::endl;
        // get palette indices as unsigned chars
        const auto nrOfColors = img.colorMapSize();
        // auto pixels = img.getConstPixels(0, 0, img.columns(), img.rows()); // needed to call this first for getConstMetacontent to work?
        auto indices = static_cast<const uint8_t *>(img.getConstMetacontent()); // <--- Exception
        const auto nrOfIndices = img.columns() * img.rows();
        for (std::remove_const<decltype(nrOfIndices)>::type i = 0; i < nrOfIndices; i++)
        {
            data.push_back(indices[i]);
        }
        std::cout << "Read " << data.size() << " pixels" << std::endl;
    }
    else
    {
        throw std::runtime_error("Unsupported image format");
    }
}
```

**CMakeLists.txt**

```cmake
cmake_minimum_required(VERSION 3.16)

find_package(PkgConfig REQUIRED)

pkg_check_modules(LIBMAGICK REQUIRED IMPORTED_TARGET
    Magick++
)

add_definitions(-DMAGICKCORE_HDRI_ENABLE=0)
add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)

add_executable(imtest imtest.cpp)
target_include_directories(imtest PRIVATE ${ImageMagick_INCLUDE_DIRS})
target_link_libraries(imtest PkgConfig::LIBMAGICK)
```

Adjust to whereever Magick++ is located for you.

### Images

_No response_
Magick++: Example needed for reading a paletted image
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Magick++: Example needed for reading a paletted image
Issue date:

--- start body ---
### ImageMagick version

7.1.1.22 built from source (8fccfab)

### Operating system

Linux

### Operating system, version and so on

Fedora 38

### Description

This is related to #6811 .

I am still trying to read the pixel data / indices a paletted image:
![new_height](https://github.com/ImageMagick/ImageMagick/assets/1310747/c33f4a16-421b-452c-a71a-38ba44f146f7)

But get the Magick::ErrorOption Exception "Magick: Unable to retrieve meta content." on calling getConstMetacontent().

In ImageMagick 6 / Magick++ the function to get indexed pixel data was called getConstIndexes(), but it does not exist anymore. From the docs [here](https://www.imagemagick.org/Magick++/Image++.html) I'm grasping that my minimal example below should read the pixels / indices fine.

### Steps to Reproduce

Minimal example:

**imtest.cpp:**

```c++
#include <iostream>

#include <Magick++.h>

int main(int argc, const char *argv[])
{
    std::cout << "Reading " << argv[1];
    Magick::Image img;
    try
    {
        img.read(argv[1]);
    }
    catch (const Magick::Exception &ex)
    {
        throw std::runtime_error("Failed to read image");
    }
    auto imgSize = img.size();
    std::cout << " -> " << imgSize.width() << "x" << imgSize.height() << ", ";
    if (img.classType() == Magick::ClassType::PseudoClass && img.type() == Magick::ImageType::PaletteType)
    {
        std::vector<uint8_t> data;
        std::cout << "paletted, " << img.colorMapSize() << " colors" << std::endl;
        // get palette indices as unsigned chars
        const auto nrOfColors = img.colorMapSize();
        // auto pixels = img.getConstPixels(0, 0, img.columns(), img.rows()); // needed to call this first for getConstMetacontent to work?
        auto indices = static_cast<const uint8_t *>(img.getConstMetacontent()); // <--- Exception
        const auto nrOfIndices = img.columns() * img.rows();
        for (std::remove_const<decltype(nrOfIndices)>::type i = 0; i < nrOfIndices; i++)
        {
            data.push_back(indices[i]);
        }
        std::cout << "Read " << data.size() << " pixels" << std::endl;
    }
    else
    {
        throw std::runtime_error("Unsupported image format");
    }
}
```

**CMakeLists.txt**

```cmake
cmake_minimum_required(VERSION 3.16)

find_package(PkgConfig REQUIRED)

pkg_check_modules(LIBMAGICK REQUIRED IMPORTED_TARGET
    Magick++
)

add_definitions(-DMAGICKCORE_HDRI_ENABLE=0)
add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_C_STANDARD 11)

add_executable(imtest imtest.cpp)
target_include_directories(imtest PRIVATE ${ImageMagick_INCLUDE_DIRS})
target_link_libraries(imtest PkgConfig::LIBMAGICK)
```

Adjust to whereever Magick++ is located for you.

### Images

_No response_
--- end body ---
