Re: MSVC 2019 comments

Bob Friesenhahn <[email protected]> Mon, 24 Feb 2020 16:29:06 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--3735943886-869693583-1582583346=:25962
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Mon, 24 Feb 2020, acorn12 wrote:
>
> Still, one of the issues for debugging under Windows will be the difference 
> between the project name and the target name, for instance UTIL_demo & 
> demo.exe.

It seems like some effort needs to be put into making this better 
since Visual Studio makes assumptions as to how things should be.

The "VisualMagick\bin" directory is where run-time programs, 
libraries, and config files normally reside for in situ execution. 
This is is messy when there are release and debug builds although the 
files are uniquely named.

> The one remaining puzzle for me was how the GM code determines where to look 
> for the necessary IM_MOD files.

I think that the core logic is in magick/magick.c as 
InitializeMagickClientPathAndName() as well as magick/module.c as 
FindMagickModule().  The module search algorithm is different for Unix 
than for Windows.

Even though InitializeMagick() allows the user to pass a path, the 
code trusts the OS more than the user and so it will learn the 
executable path (maybe the the path to the core magick library) from 
the OS if possible.

> At this time I was still working my way through some of the options, but have 
> found this line in the log output:
>
>  Configure Event Searching for file "modules.mgk" in path "C:\Program Files 
> (x86)\GraphicsMagick-1.3.34-Q8\;C:\Program Files 
> (x86)\GraphicsMagick-1.3.34-Q8\\;D:\pkg\C++\MSVC2019\GM\gm-c031-d3ed\VisualMagick\bin\;"
>
> But all the modules.mgk files are essentially 'empty'

This is because there is a default configuration in magick/modules.c 
(via magick/module_aliases.h) and so there is already knowledge of 
default modules.  It provides an opportunity to provide more 
information.

By default format 'FOO' will load the 'FOO' module.  However, there 
might not be a loadable module for format 'ZZZ' and thus the modules 
information provides the clue that 'ZZZ' is handled by the 'AAA' 
module and so when the format is known to be 'ZZZ' we search for the 
'AAA' module instead.

> More work eventually led me to define the environment variable
>
> MAGICK_HOME=D:\pkg\C++\MSVC2019\GM\gm-c031-d3ed\VisualMagick\bin\

Also see MAGICK_CODER_MODULE_PATH and MAGICK_FILTER_MODULE_PATH as 
described in the documentation.

> As part of the debug process, I have also found that, at least in my case,  
> the call to InitializeMagick( static_cast<const char*>( wsDlls)); does really 
> nothing at all because the DLLs and their paths have been set when 
> CORE_DB_magick_.dll is initialized.

Right.  If CORE_DB_magick_.dll can get its location from the OS, then 
it goes with that.

> In any case, it looks like I have sorted out how to use GM libraries in my 
> app and now the next step is to actually generate the thumbnials using

Good!

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt
--3735943886-869693583-1582583346=:25962
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--3735943886-869693583-1582583346=:25962
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Graphicsmagick-apis mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-apis

--3735943886-869693583-1582583346=:25962--