Header file problems

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
FireDragon
Posts: 2
Joined: 2015-08-11T06:32:33-07:00
Authentication code: 1151

Header file problems

Post by FireDragon »

I downloaded Magick to try it on a minor image editing task I had (I was successful, and Magick appears to be very well done).

I am using VC 2015 and had to make some minor header changes to get a clean compile. As far as I can tell, all of these changes should be standard. I also had a problem when compiling in debug mode. Everything compiled cleanly, but I was unable to call Image::read() successfully. I traced it down to -MTd on the compile line. Changing that to -MT corrected the problem. Of course, that flag is needed for debugging. Anyway, on to the header changes. Its quite possible that a .dll compiled with -MD instead of -MDd using an older compiler like VC 2012 and linked to VC 2015 would be a problem in its own right.

1. In Magick++.h lines 10..15, #include <> was changed to #include "". The <> brackets are for system headers, which is not Magick headers.

2. In Magick++\Include.h, lines 42..43, #include <> was changed as above.

3. In magick\pixel-accessor.h, line 202 was changed from

intensity=0.212656*pixel->red+0.715158*pixel->green+0.072186*pixel->blue;

to

intensity=MagickRealType(0.212656*pixel->red+0.715158*pixel->green+0.072186*pixel->blue);

The constants 0.212656, 0.715158 and 0.072186 are type double which promotes the expression type to double which then causes a warning message about possible loss of data. The constants could have been replaced with "F" versions, but that could be a problem if MagickRealType is of type double instead of type float.

Thanks for the great product!
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Header file problems

Post by dlemstra »

We have not yet tried to build ImageMagick under VS 2015. We will address these issues when we will upgrade from VS 2013 to VS 2015, this is planned for September/October.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
FireDragon
Posts: 2
Joined: 2015-08-11T06:32:33-07:00
Authentication code: 1151

Re: Header file problems

Post by FireDragon »

None of these issues were related to VS 2015. The include <> issues would have affected any compiler. Probably most people put the headers on the include path. I didn't do that since I was just giving it a try.

The remaining issue is probably due to my using a high level of warning flags. Again, not something that is really specific to VS 2015.

These are both basic issues.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Header file problems

Post by magick »

We fixed the pixel-accessor.h header problem in Git, available within a few minutes. We'll fix the Magick++ problem soon. Thanks for the problem report.
Post Reply