PDA

View Full Version : QProcess error to call mogrify



mattia
29th October 2007, 11:26
Hello, i was trying the QProcess class with a simple program, i made an interface to call mogrify program and convert an image. This is the code used to start the process:


void ConvertDialog::on_convertButton_clicked()
{
QString sourceFile = sourceFileEdit->text();
convertButton->setEnabled(false);
outputTextEdit->clear();

QStringList args;
QString size = "-resize " + sizeComboBox->currentText().toLower();
args << size << sourceFile;

QString commandDebug = "command: ";
int i;
for(i = 0; i < args.size(); i++){
commandDebug += args.at(i);
}
textBrowser->setText(commandDebug);
process.start("mogrify", args);
}


when i start it, it shows me this error:
mogrify: unrecognized option `-resize 800x600'.

but this option is available on mogrify. Any ideas?

jpn
29th October 2007, 11:30
Try:


QStringList args;
QString size = sizeComboBox->currentText().toLower();
args << "-resize" << size << sourceFile;

mattia
29th October 2007, 11:46
thanks a lot! it works!