I would first try it at the commandline - with a 'normal' ImageMagick v6.5.9 (as you wrote that your DLL is based on that). If that is working for you, then you can try with your DLL.
graemeNPS wrote:I am trying to avoid changing this command, as we have used it as-is on hundreds of thousands of image conversions.
Okay, but then you won't be able to produce a reasonable output with documents like 'msd_ko.ai'. You have to decide whether it is worth adapting the command in your DLL. (I'm not even sure whether a 'one-command-fits-all' is possible with such cases.) I mean, one could say, that this type of documents is saved in a non-compatible way. As I wrote, even the official Adobe Reader (on Windows) shows only a white page with your file (with default settings). That is because regular PDF applications (AFAIK) flatten over a white background when they have transparency. And with documents that have pure white (in the normal RGB channels), with an additional alpha channel, flattening over white again produces a pure white, so that's bound to fail. But that's more the fault of the input file.
The question also is: Which result do you expect - how should the preview for 'msd_ko.ai look like? I also don't have Adobe Illustrator here, so.. How does it look like in Illustrator? Perhaps it shows the transparent regions as checkerboard or something like that. That, you could simulate with ImageMagick of course. But that would generate very strangely looking previews sometimes (text pages over a checkerboard).
So, if you decide that you want a good-looking preview for PDFs/AIs like 'msd_ko.ai', then you'll have to read a transparent image. When that is working, either keep it like that (when saving as PNG), or flatten over a non-white background (when directly saving as JPG - as JPG can't store transparency). But you can't use this type of command with every single input file. You could check whether the RGB channels only have a plain white - and only then flatten over black or something like that. Perhaps someone else has a better idea.
graemeNPS wrote:convert -auto-orient -size 1224x792 msd_ko.ai[0] -alpha Off -resize 512x512 -profile "C:\Program Files\IPieces\profiles\sRGB.icm" +profile "*" 1308viewx.jpg
Doing that fails with 'msd_ko.ai', as the information about the shape of the logo is only (!) in the alpha layer. And you are sort of deleting the alpha layer with "-alpha off". As I said, you have to flatten over e.g. black. (Additionally: I could be wrong, but I think that "-auto-orient" and "-size" are useless here - at least for PDF/AI. And adding the sRGB profile: that does something - sometimes. But if you have Ghostscript v9.00 or newer, you can leave that away, too - and instead just add "-colorspace RGB" before the input file. That way, Ghostscript will always deliver a sRGB output to ImageMagick. Much more reliable. At least that's the default with the current Ghostscript binaries for Windows.)
So, I would use a command like that:
Code: Select all
convert -colorspace RGB msd_ko.ai[0] -background black -flatten -resize 512x512 -strip 1308viewx.jpg
The logo will be very small, but that's how the input file looks like. It should even work with ImageMagick v6.5.9. But it's possible that you have to alter your delegates.xml, as described in the last post. (My IM 6.5.8 version is using 'pnmraw' as default with your file, so the command would fail without changing the delegates. If you want to know which GS device ImageMagick is using, then add "-verbose" at the commandline.)
But remember: 'background black' is only for this type of documents, not for all documents (the default is white). It IS even possible to leave away the background option here:
Code: Select all
convert -colorspace RGB msd_ko.ai[0] temp.png
convert temp.png -flatten -resize 512x512 -strip 1308viewx.jpg
That works, too. But only with a current ImageMagick version, and only due to sort of a mini-bug in the current ImageMagick.
So, I would recommend the upper command.