IM4Java ライブラリを介して Image Magick を使用して画像のサイズを変更しようとしています。
画像が中央にないことを除いて、うまく機能します。外部コマンドラインからこれらの同じコマンドを実行しましたが、うまく機能します。
これが機能しない理由を誰か教えてもらえますか?
private void convertImage(int width, int height, String source, String dest)
throws IOException, IM4JavaException, InterruptedException
{
// create command
ConvertCmd cmd = new ConvertCmd();
// create the operation, add images and operators/options
IMOperation op = new IMOperation();
op.addImage(source);
op.thumbnail(width, height, ">");
op.extent(width, height);
op.gravity("center");
op.background("white");
op.addImage(dest);
ProcessStarter.setGlobalSearchPath("/usr/local/bin");
cmd.setOutputConsumer(imageMagickOutputter);
cmd.run(op);
}