DMagick image processing with D.

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Nov 2 18:54:23 PDT 2011


I was trying to export pixels:
auto pixels = image.exportPixels!byte(area, "RGB");

But got:
..\dmagick\Image.d(1340): Error: cannot implicitly convert expression
(pixels) of type void[] to byte[]

I think you might need to change Line 1340, dmagick/Image.d:
return pixels;

to this:
return cast(typeof(return))pixels;

Still, with this change I get an access violation in the statement
before it that calls ExportImagePixels. Ddbg says:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at
CORE_RL_magick_.dll (0x100c1267) thread(3440)

These were my calls:
    Image image = new Image("newbitmap.bmp");
    int x, y;
    auto area = Geometry(100, 100, x, y);
    auto pixels = image.exportPixels!byte(area, "RGB");

newbitmap.bmp is a 614x768x8bit bitmap.


More information about the Digitalmars-d-announce mailing list