Export to image "Quality (0-100)" window.

Help
2006-08-15
2012-11-04
  • david moore

    david moore - 2006-08-15

    When I use
    exportPlot("output.jpg", "JPEG");
    in a script I get a pop up window with a title of "Export to image" and an input box labeled
    "Quality (0-100)".
    This dialog effectively pauses the script until I manually enter this value.

    Is there any way to prevent the dialog box or answer it from the script?

     
    • david moore

      david moore - 2006-08-31

      I have a work around for this problem but it is not quite optimum...

      from your script use exportEPS

      exportEPS("output.eps");

      Then use image magick's convert utility (from Perl in this case.)

      system("convert -rotate \"90\" output.eps output.jpg");

      Better answers would be appreciated.

       
    • Stefan Gerlach

      Stefan Gerlach - 2006-09-04

      The dialog about the quality for exporting is hardcoded in LabPlot 1.5.1.
      I have fixed this problem now in 1.6.0.pre2 where you can use
      exportPlot("output.jpg", "JPEG", 75);
      to avoid this dialog.

      I can tell you which lines needs to be modified in the source code if want to recompile LabPlot.

      Thanks for reporting.

       
      • david moore

        david moore - 2006-09-05

        Thanks for the fix. The ability to directly output to jpeg should improve the quality and speed up the output.

        Yes, I would be interested in the source code lines that need to be fixed.

        I appreciate all your work on this project!

        DAM

         
        • Stefan Gerlach

          Stefan Gerlach - 2006-09-05

          In LabPlot 1.5.1.4 you have to change the lines 1983-1985 :

          bool ok;
          int quality = QInputDialog::getInteger(i18n("Export to image"),i18n("Quality (0-100)"),75,1,100,1,&ok);
          if(!ok) return;

          to something like :

          int quality = 75;

          This doesn't allow you to set the qualiy per script, but it prevents this nasty dialog.

          hope this helps :-)

           
          • david moore

            david moore - 2006-09-05

            Thanks, I will try this.

            I assume that int quality is valid from 0 to 100.

            Again, I appreciate your help!

            DAM

             

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks