fill given area operator (^) not working?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
jlp2097
Posts: 2
Joined: 2016-03-06T13:21:49-07:00
Authentication code: 1151

fill given area operator (^) not working?

Post by jlp2097 »

Hi,

I am trying to resize an image with the dimensions 3264x1836 with the Geometry specification 1280x1280^. The expected output is a file with the dimensions 2276x1280. This works fine when using command-line convert:

Code: Select all

convert 160102-IMG_20160102_122843.jpg -resize 1280x1280^ test.jpg
However my program generates a file with the dimensions 1280x720. Does anyone know why this happens? My code:

Code: Select all

#include <cstring>
#include <iostream>
#include <string>
#include <libgen.h>
#include <Magick++.h>
#include <sys/stat.h>

using namespace std;
using namespace Magick;


int main (int, char **argv)
{
  InitializeMagick (*argv);
  Image im;
  string src = argv[1];

  try
  {
    im.read (src);
    im.resize ("1280x1280^"); //XL: max. 1280
    im.write ("test.jpg");
  } 
  catch (const std::exception & e)
  {
    cerr << e.what () << endl;
  }
}
Build line is

Code: Select all

g++ `Magick++-config --cxxflags --cppflags` -O3 -Wall -o thumbgenerator thumbgenerator.cpp `Magick++-config --ldflags --libs`
Version output of convert is
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
jlp2097
Posts: 2
Joined: 2016-03-06T13:21:49-07:00
Authentication code: 1151

Re: fill given area operator (^) not working?

Post by jlp2097 »

Solved it. Seems that even though that ImageMagick 6.7.7 is the latest version on Linux Mint, it is quite outdated. This version does not support the fillArea operator (but also does not complain about it). Updating to a recent Imagemagick version solved it.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: fill given area operator (^) not working?

Post by dlemstra »

Thanks for coming back to the forum and posting how you solved it :)
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply