Issue with CRT/std::string
Posted: 2008-10-07T16:14:00-07:00
Any time I try to load an image from a file, i.e.:
Magick::Image("C:\\Test.bmp")
It crashes in std::string related functions. I think the problem is that it looks like the library was compiled with MSVCRT 7.1, while I am using 8.
I need a workaround for this problem. I don't see a plain old char pointer member, so it looks like my next best option is to load the file into a Blob myself (so I can open the file with my version of the CRT), and then pass the blob to the Magick::Image constructor instead of the filename.
My question is that I need this to be relatively fast (I am dealing with image sequences of movies), is this going to be significantly slower than the method of passing the string and having the library do the work? Will I be sacrificing functionality by doing this? I need some of the more exotic image types to work (exr, dpx) so I need all the formats to support working with blobs.
A cursory look at the source of Image.cpp did not reveal whether there would be a difference between the two.
edit: I went ahead and implemented this workaround, and it works. This tells me that it most likely is the source of the crash. So all I need to know is that I'm not losing functionality or performance by doing this.
Magick::Image("C:\\Test.bmp")
It crashes in std::string related functions. I think the problem is that it looks like the library was compiled with MSVCRT 7.1, while I am using 8.
I need a workaround for this problem. I don't see a plain old char pointer member, so it looks like my next best option is to load the file into a Blob myself (so I can open the file with my version of the CRT), and then pass the blob to the Magick::Image constructor instead of the filename.
My question is that I need this to be relatively fast (I am dealing with image sequences of movies), is this going to be significantly slower than the method of passing the string and having the library do the work? Will I be sacrificing functionality by doing this? I need some of the more exotic image types to work (exr, dpx) so I need all the formats to support working with blobs.
A cursory look at the source of Image.cpp did not reveal whether there would be a difference between the two.
edit: I went ahead and implemented this workaround, and it works. This tells me that it most likely is the source of the crash. So all I need to know is that I'm not losing functionality or performance by doing this.