Blob::updateNoCopy() cause a "Application.exe has triggered a breakpoint"

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
stryku
Posts: 1
Joined: 2015-12-06T07:36:03-07:00
Authentication code: 1151

Blob::updateNoCopy() cause a "Application.exe has triggered a breakpoint"

Post by stryku » 2015-12-06T07:55:53-07:00

Hello everyone!

I think I need some help.

I'm working on shared library that use Magic++ static libraries (idk if it's important). I use ImageMagick-6.9.2-7, installed on windows by wizard, not builded from sources. I'm working in Visual Studio Enterprise 2015.

Ok so here's simple code that cause that problem

Code: Select all

int changeBrightness( void *imegeData, const size_t size, double changeValue )
{
    try
    {
        static std::once_flag once;

        std::call_once( once, Magick::InitializeMagick, "" );

        Magick::Blob blob;

        blob.updateNoCopy( imegeData, size );

        Magick::Image img( blob );

        img.modulate( changeValue, 100.0, 100.0 );
    }
    catch( std::exception &e )
    {
        std::cout << e.what();
    }

    return 1;
}

int main()
{
    std::vector<uint8_t> data = readFile( "some\\path\\img.png");
    
    changeBrightness( &data[0], data.size(), 10.0 );

    return 0;
}
And at the end of try block program breaks with information "Application.exe has triggered a breakpoint".

If I write

Code: Select all

blob.update( imegeData, size );
instead of

Code: Select all

blob.updateNoCopy( imegeData, size );
everything is ok.

There's possibility that I've misunderstand how blobs works. Please give me some information if that's the problem (:

I'm using vector because user of my library'll provide pointer to raw data form file and I need to work with that.

Post Reply