Results 1 to 3 of 3

Thread: QProcess error to call mogrify

  1. #1
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QProcess error to call mogrify

    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:
    Qt Code:
    1. void ConvertDialog::on_convertButton_clicked()
    2. {
    3. QString sourceFile = sourceFileEdit->text();
    4. convertButton->setEnabled(false);
    5. outputTextEdit->clear();
    6.  
    7. QString size = "-resize " + sizeComboBox->currentText().toLower();
    8. args << size << sourceFile;
    9.  
    10. QString commandDebug = "command: ";
    11. int i;
    12. for(i = 0; i < args.size(); i++){
    13. commandDebug += args.at(i);
    14. }
    15. textBrowser->setText(commandDebug);
    16. process.start("mogrify", args);
    17. }
    To copy to clipboard, switch view to plain text mode 

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

    but this option is available on mogrify. Any ideas?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QProcess error to call mogrify

    Try:
    Qt Code:
    1. QString size = sizeComboBox->currentText().toLower();
    2. args << "-resize" << size << sourceFile;
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. #3
    Join Date
    Oct 2007
    Location
    Italy
    Posts
    172
    Thanks
    39
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QProcess error to call mogrify

    thanks a lot! it works!

Similar Threads

  1. QProcess / system call not working under linux. Why?
    By johnny_sparx in forum Qt Programming
    Replies: 12
    Last Post: 11th March 2006, 00:32

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.