Crash on function "read("...")"

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
Vasyl
Posts: 2
Joined: 2016-11-01T04:42:55-07:00
Authentication code: 1151

Crash on function "read("...")"

Post by Vasyl »

Hello. Could you please, help me? I use ImageMagick 6.9.6 on Windows in my Qt project. Everything runs perfectly except for the

Code: Select all

Magick::Image image; image.read("2.jpg")
function. Intercepted exception looks like this

Code: Select all

consolemagick.exe: UnableToOpenBlob `2.jpg': No such file or directory @ error/blob.c/OpenBlob/2705
Help me please in solving this problem… Below is the example of the code of simple console application in QtCreator

Code: Select all

#include <iostream>
#include <Magick++.h>
#include <Magick++/Image.h>
#include <Magick++/Blob.h>
#include <magick/blob.h>
using namespace std;

int main(int argc, char *argv[])
{
    Magick::InitializeMagick(*argv);

    cout << "Hello World!" << endl;
    Magick::Image img;
    try{
    img.read("2.jpg");
    }catch(Magick::Exception &error_){
        cout<<error_.what();
        return 1;
    }
    cout<<img.geometry().width();
    return 0;
}
Last edited by Vasyl on 2016-11-01T05:38:51-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Crash on function "read("...")"

Post by snibgo »

Vasyl wrote:No such file or directory
Do you have a file named 2.jpg in that directory?
snibgo's IM pages: im.snibgo.com
Vasyl
Posts: 2
Joined: 2016-11-01T04:42:55-07:00
Authentication code: 1151

Re: Crash on function "read("...")"

Post by Vasyl »

Yes , of course)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Crash on function "read("...")"

Post by snibgo »

What do "dir" and "identify" show for that file?
snibgo's IM pages: im.snibgo.com
Post Reply