简体   繁体   中英

ImageMagick open and write image with qt ans magick++

Im using Magick++ Library with Qt

Im using the following code to read and write an image:

  Image image;
  image.read(qPrintable(f.absoluteFilePath()));
  image.addNoise(GaussianNoise);
  image.magick("png");
  image.write("image_name");

Where f.absoluteFilePath is the absolute path for my image Example: /Users/user/Desktop/test/P1030673.jpg

After the completion of the code, I cannot locate the image named 'image_name'. I looked into the folder of the first image '/Users/macmini/Desktop/test/' and its not there I tried to search the image, but it seems is not in my computer.

Where do I go wrong? How can I save the image in my computer? is there any way to specify the path that I want the image to be saved?

Thank you

You should find the file saved in the current working directory. If you want to save it elsewhere give an absolute path.

For everyone who might have tha same problem: Imagemagick will save the images inside the .app bundle

You will not be able to find the image files unless you specify a path inside the read() function

I noticed the following by checking the size of my .app file It was increased everytime I was trying to save images.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM