Yes thanks! The demo works fine.
I've also tried to change the code. It now converts size & extensions of other files.
But when i try to convert a pdf-file into jpg i got a error.
Do i have to install something extra to do this?
Or do i have to write other code?
program wanddemo;
{$mode objfpc}{$H+}
uses SysUtils, magick_wand, ImageMagick;
procedure ThrowWandException(wand: PMagickWand);
var
description: PChar;
severity: ExceptionType;
begin
description := MagickGetException(wand, @severity);
WriteLn(Format('An error ocurred. Description: %s', [description]));
description := MagickRelinquishMemory(description);
Abort;
end;
var
status: MagickBooleanType;
wand: PMagickWand;
begin
{ Read an image. }
MagickWandGenesis;
wand := NewMagickWand;
try
status := MagickReadImage(wand, 'Picture 0026.pdf');
if (status = MagickFalse) then ThrowWandException(wand);
{ Turn the images into a thumbnail sequence. }
MagickResetIterator(wand);
while (MagickNextImage(wand) <> MagickFalse) do
MagickResizeImage(wand, 270, 270, LanczosFilter, 1.0);
{ Write the image as MIFF and destroy it. }
status := MagickWriteImages(wand, 'Picture 0026.jpg', MagickTrue);
if (status = MagickFalse) then ThrowWandException(wand);
finally
wand := DestroyMagickWand(wand);
MagickWandTerminus;
end;
end.
The red text is the only thing that I've changed in the demo code.
You can see, not that much...
The picture0026.pdf file is in the same folder as the demo image.
I've tested this with images with other extensions & it works perfect.
I hope you can help me succeed in this!
Thanks for all the help so far!
Jeffrey