how to configure vs2010 build to work

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
graemeNPS
Posts: 64
Joined: 2009-01-12T14:25:55-07:00

how to configure vs2010 build to work

Post by graemeNPS »

my workflow uses dlls built with visual studio 2010.
I need the latest imagemagick to get the ability to turn off auto grayscaling (see my other topic:rgb converted to grayscale by imagemagick )
The dll's I build to use the imagemagick do not work with the latest window 6.9.3 installer, which I guess in a VS 2013 or 2015 build.

I have built IM 6.9.3.1 from source using visual studio 2010. the basic conversion of a tiff to jpg using a convert command works.
But, I have problems trying to convert e.g. a dng to a jpg. I assume it is a registry/configuration problem.
I have copied all the exe and dlls from the build to:
C:\telescope\IMBin
I have added C:\telescope\IMBin to the PATH variable.

version of convert works:
C:\TeleScope>convert -version
Version: ImageMagick 6.9.3-1 Q16 x86 2016-01-22 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 160040219
Features: Cipher DPC Modules
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangoca
iro png ps rsvg tiff webp xml zlib


but the modules are not found for the dng conversion:

C:\TeleScope>convert c:\windows\temp\NPS_DNGCopy4696_26280.dng foo.jpg
convert.exe: unable to open module file `C:\Users\Administrator\AppData\Local\Im
ageMagick\IM_MOD_RL_TIFF_.dll': No such file or directory @ warning/module.c/Get
MagickModulePath/830.
convert.exe: no decode delegate for this image format `TIFF' @ error/constitute.
c/ReadImage/501.
convert.exe: no images defined `foo.jpg' @ error/convert.c/ConvertImageCommand/3
241.

C:\TeleScope>
graemeNPS
Posts: 64
Joined: 2009-01-12T14:25:55-07:00

Re: how to configure vs2010 build to work

Post by graemeNPS »

more details: seems to work as a command line calling convert but not from the MagickCore::ConvertImageCommand API

I have compiled 6.9.3.1 in visual studio 2010, copied all the VisualMagick/bin files to c:\telescope\IMBin
I have path set to c:\Telescope\IMBin

// we use image magick thus to convert a file, with the logged command line:
..begin code snippet
//setup ImageMagick for a conversion...

MagickCore::ImageInfo *image_info;
MagickBooleanType status;
Magick::InitializeMagick(*argvnps);

MagickCore::ExceptionInfo* pMCException;
pMCException = MagickCore::AcquireExceptionInfo();

image_info=MagickCore::CloneImageInfo((MagickCore::ImageInfo *) NULL);

status= MagickCore::ConvertImageCommand(image_info, argc, argvnps, (char **) NULL, pMCException);
..end code snippet


this is the command we are passing to ConvertImageCommand(....), but it does not work, the output file is not generated:
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [convert]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [-auto-orient]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [C:\Windows\TEMP\NPS_DNGCopy3604_27353.dng[0]]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [-alpha]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [Off]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [-resize]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [512x512]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [-profile]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [c:\TELESC~1\IPieces\ImageMagick\sRGB.icm]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [+profile]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list ["*"]
01/25/2016 15:58:59 [ET:0000066125] 3604:6004 [DEBUG] DNGAPIWrapper::GetFileInfo(): the argv list [C:\Windows\TEMP\NPS_DNGViewX3604_13782.jpg]

//as a command line in Telescope directory, works fine:
C:\TeleScope>convert -auto-orient C:\Windows\TEMP\NPS_DNGCopy3604_27353.dng[0] -alpha Off -resize 512x512 -profile c:\TELESC~1\IPieces\ImageMagick\sRGB.icm +profile "*" C:\Windows\TEMP\NPS_DNGViewX3848_23388.jpg
Post Reply