has anybody used delphi2009 and Magickwand? I cannot get it working.
The MagickReadImage function return 0 and the error description returns just unreadable characters.
Has somebody an idea?
Thanks
edgar
Code: Select all
//uses ImageMagick,magick_wand,
// wrapper from http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=174103&release_id=431432
procedure TfrmPicDialog.aclTestExecute(Sender: TObject);
var
status: MagickBooleanType;
wand: PMagickWand;
procedure ThrowWandException(wand: PMagickWand);
var
description: PChar;
severity: ExceptionType;
begin
description := MagickGetException(wand, @severity);
showmessage(Format('An error ocurred. Description: %s', [description]));
description := MagickRelinquishMemory(description);
Abort;
end;
begin
MagickWandGenesis;
wand := NewMagickWand;
try
status := MagickReadImage(wand,'image.png');
if (status = MagickFalse) then ThrowWandException(wand);
MagickResetIterator(wand);
while (MagickNextImage(wand) <> MagickFalse) do
MagickResizeImage(wand, 106, 80, LanczosFilter, 1.0);
status := MagickWriteImages(wand, 'image.jpg', MagickTrue);
if (status = MagickFalse) then ThrowWandException(wand);
finally
wand := DestroyMagickWand(wand);
MagickWandTerminus;
end;
end;