Results 1 to 17 of 17

Thread: ImageMagick and QT

  1. #1
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default ImageMagick and QT

    Qt Code:
    1. Blob imageBlob;
    2. image.magick("XPM");
    3. image.write(&imageBlob);
    4. const QByteArray imageData((char*)(imageBlob.data()));
    5. (QPixmap(*this)).loadFromData(imageData);
    To copy to clipboard, switch view to plain text mode 

    I am using the ImageMagick for image manipulation and the above code crash on

    Qt Code:
    1. const QByteArray imageData((char*)(imageBlob.data()));
    To copy to clipboard, switch view to plain text mode 


    Can someone help?

  2. #2
    Join Date
    Jan 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ImageMagick and QT

    I don't know anything about ImageMagick Blobs, but the QByteArray constructor that you're using is expecting a null-terminated string, and I suspect that Blob::data() does not provide that. You may want to try this QByteArray constructor:

    QByteArray::QByteArray ( const char * data, int size )

  3. #3
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: ImageMagick and QT

    Thanks for your reply. It worked!!

    Can someone tell me what dlls or files from ImageMagick to be supplied when deploying an application? It should not be necessary for user to install ImageMagick on his/her machine.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: ImageMagick and QT

    Run depends.exe on your binary. It will tell you about all required dependencies.

  5. #5
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: ImageMagick and QT

    Hi wysota,

    thanks for the reply. That was the first thing I did. It is something specific to ImageMagick. The application is running but not showing up the images. If I keep the ImageMagick installed folder intact, everything works. As soon as I rename the installed folder, application does not show up the images.

    Regards,
    Manoj

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: ImageMagick and QT

    It will tell you the actuall DLL files and their paths. Most probably it's just libMagick (magick.dll or libmagick.dll).

  7. #7
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: ImageMagick and QT

    You are right Wysota. It tells the dll names and I also include all those dlls with my deployment, then only the application runs. But does not show up the images!!

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: ImageMagick and QT

    Maybe the problem is with Qt and not ImageMagick? Did you remember to deploy the image plugins with your application?

  9. #9
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: ImageMagick and QT

    Yes. I deployed plugins also. It seems to be a Image Magick problem only. As I already said, If I keep the installed Image Magick folder intact everything works. As soon as I rename that folder, application stops showing up the images.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: ImageMagick and QT

    Maybe there are some hardcoded paths there? How do you load ImageMagick? Through some plugin or you link against it compile-time?

  11. #11
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: ImageMagick and QT

    I am using compile time linking. Where are you talking to look into for hard coded paths?

    Thanks for all your help wysota.

  12. #12
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ImageMagick and QT

    After you load your program into Dependency Walker, select "Start profiling" (F7) to see which dlls are loaded dynamically at run time. That should give you an idea what your missing.

  13. #13
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: ImageMagick and QT

    I don't have this option in my utility (depends) installed with Visual Studio 6 and I did not get dependancy walker with Visual Studio 2005 installed on my machine.

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: ImageMagick and QT

    You can download the dependency walker from the net. At least you could have some time ago...

  15. #15
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ImageMagick and QT

    I got mine with the platform sdk. in "C:\Program Files\Microsoft Platform SDK\Bin\".
    Or go to http://dependencywalker.com/

  16. #16
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: ImageMagick and QT

    Yes, I got the new utility installed and it tells some new things. :-)

    The application needs some more dlls, and paths for all those dlls are hard coded in other Image Magick dlls. Even If I copy those dlls into my deployment folder, it does not work.

  17. #17
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: ImageMagick and QT

    Hi!

    I am just stuck with this. I have tried every method to deploy Image Magick application.
    (1) I downloaded and installed ImageMagick-6.4.0-4-Q16-windows-dll.exe. When I try to use the dlls from this, my application always search for the installed location of Image magick for module dlls and coders.
    (2) I downloaded and installed ImageMagick-6.4.0-4-Q16-windows-static.exe. It has only lib files and they are very big in size. i don't want to build my application big for only Image Magick.
    (3) I downloaded and compiled the windows source code for dynamic dlls keeping the #undef MAGICKCORE_INSTALLED_SUPPORT uncommented. It builds all the dlls, modules and xml files in visualmagick/bin folder. I tried to copy the dlls from this with my application. The application crashes!!
    (4) I tried building the source code in static mode but this also creates the big libs which I am not much interested to use.

    *Note*
    I tried building my application with static libraries from Image Magick but it produces linker errors for all Image Magick functions.

    Please help!!

    Regards,
    Manoj

Similar Threads

  1. Qt + ImageMagick
    By bpetty in forum Newbie
    Replies: 8
    Last Post: 23rd April 2007, 21:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.