I have managed to get this working via command line arguments (I used mogrify not convert).
The code below throws an exception during the read(). The exception is:
Thumbnail Generation failed: XiThumbnail.exe: unable to open image '(÷.c»': Invalid argument @ error/blob.c/OpenBlob/2695
Code: Select all
std::string SrcPath = "T:\Catfish\trunk\catfish\Tools\XiThumbnail\x64\Debug\a(C).TIF";
TheImage.read(SrcPath); // Load the image.
TheImage.magick(ThumbnailFormat.GetBuffer(0)); // Set the destination format.
Magick::Point Sample((double)nThumbnailResolutionDPI, (double)nThumbnailResolutionDPI);
TheImage.resample(Sample); // Resample to the required resolution.
TheImage.depth(8); // Make it an 8-bit thumbnail.
CString DestPath = _T("");
if(TargetFolder.IsEmpty())
TargetFolder = RemoveExtension(SrcFile) + _T(".") + ThumbnailFormat;
else
JoinPath(TargetFolder, RemoveExtension(GetLeafname(SrcFile))) + _T(".") + ThumbnailFormat;
dst = TargetFolder.GetBuffer(0);
TheImage.write(dst); // Save it to disk in the target location.
Thanks,
Peter Young