Menu

tv command shows a black window

Help
Oren Shani
2017-11-20
2017-11-21
  • Oren Shani

    Oren Shani - 2017-11-20

    Hi All,

    I am trying to follow the simple examples, given here:

    http://blog.redbranch.net/2011/07/06/gdl-beginner-code-examples/

    The plot command work, but when I try displaying an image with tv or tvscl, the image is not displayed and only a black window appear.

    I am running gdl on Ubuntu. I tried 16.04 and 17.10 . Same problem. The image is displayed correctly with other imagemagick based tools ( e.g. gm ).

    Also, I am not sure this is realted, but I gett the following warning when:

    GDL> read_jpeg, file, image
    % Compiled module: READ_JPEG.
    % WARNING: your version of the GraphicsMagick library will truncate images to 16 bits per pixel

    Any help will be appreciated.

    I am completley new to gdl, so I apologize in advance if this was asked before, etc.

    Many thanks,

    Oren

     
  • giloo

    giloo - 2017-11-20

    Hello,
    What version of gdl do you use? It is written when GDL starts.
    And, what is the default visual of your display? This can be found with the command 'xdpyinfo'

    for the record: 16 bpp GraphicsMagick is pretty good, many distributions build only a 8bpp GraphicsMagick library. This is an informational message and should not have been tagged as %WARNING.

     
  • GregJung

    GregJung - 2017-11-20

    In general, TV is a weak link in the GDL code - this is a good image file to stress-test it. To see the simple things your GDL can do, "TEST_TV" from gdl/testsuite should show you three different color images of saturn. After seeing this succeed I re-ran the same routine to read in "moon.jpeg" and it produce a segfault error (!). I read the file in OK with the routine referenced, but (in windows' 7 graphics) tv gave me a purple featureless window. The command "CONTOUR, reform(image[0,,]) did make a recognizable 2-d moon-contour plot - so the image was there.

     
  • Alain C.

    Alain C. - 2017-11-20

    wget http://upload.wikimedia.org/wikipedia/commons/c/c8/Lunar-eclipse-09-11-2003.jpeg

    This is working since years ... as long as you don't forgot this image is a 3D array
    then you need to use TV, image, /TRUE

    gdl
    GDL> print, !gdl
    { 0.9.7 CVS Nov 14 2017 1510614000}
    GDL> read_jpeg, 'Lunar-eclipse-09-11-2003.jpeg', image
    GDL> help, image
    IMAGE BYTE = Array[3, 604, 602]
    GDL> tvscl, image,/tr

    Obviously we welcome any bug and feedback

     
  • giloo

    giloo - 2017-11-20

    below a copy of test_tv running on a fresh ubuntu 17.10 (using VirtualBox). No problems found.

     
    • GregJung

      GregJung - 2017-11-21

      There are problems with the newer test_tv, the first series of windows should have incremental
      color tables as the images in window 9; and other problems in the windows you haven't shown.

      I needed to add an "ESCAPE_SPECIAL_CHAR() into file_which.pro for the /include_current_dir
      option, when I tried to pick up 'moon.jpeg' from directory "/d/Chrome Downloads/examples".:

      line 105:

          ;;
          ;; now apath should be the full path of the file
          apath = apath + path_seper + the_file
          if( !version.os_family NE 'Windows') then $
              apath = ESCAPE_SPECIAL_CHAR(apath)
          ;;
      

      I couldn't get "moon.jpeg" to substitute for Saturn.jpg - probably a sizing issue - but I was able to see the moon manually when the /true keyword was used.

       
      • Alain C.

        Alain C. - 2017-11-21

        1/ please, which problems in current version of "test_tv.pro" (as is in the CVS) ?
        (the important point for us was the speed improvment, may be we did not see another problem ?)

        2/ could you explain your problem around "file_which.pro", which is not used in test_tv or in testsuite/ except for "test_file_which.pro" ? May be better to open a bug report ?

        3/ how to subtitute ? current version of "test_tv.pro" is not ready to change the image we use (Saturn usage is harcoded now). Not really needed, since "moon" is equivalent to "Saturn" and Saturn.jpg is in the CVS

        A.

         
        • GregJung

          GregJung - 2017-11-21

          Now that I've worked with the program a bit more, I see it isn't failing but it was visually quite different than my expectation from the earlier test_tv. This earlier version used FILE_WHICH to obtain Saturn.jpg, which was fine until I adapted it to get "moon.jpeg" located in a directory under a directory containing spaces. And so the proposed change for file_which.

          When I begin the session by clearing the !path I remove a lot of my confusion. And so the distracting windows are created for verifying TVRD. In the attachment below, I've modified the test a bit so that they (windows 0,2) are deleted after usage.

           
  • giloo

    giloo - 2017-11-20

    additionnally it is a pity ubuntu does not distribute plplot with the wxwidgets driver.
    One would have to recompile plplot to get graphics widgets, such as "atv".
    message is:
    % TEST_WIDGETS: PLplot installation lacks the requested driver: wxwidgets
    % Execution halted at: TEST_WIDGETS 128 /home/osboxes/testsuite/test_widgets.pro

     
  • Alain C.

    Alain C. - 2017-11-21

    no ! you just need to add a package, as it is for xwin :

    $ dpkg -l plplot
    [...]
    ii plplot12-driver-wxwidgets: 5.10.0+dfsg2-0.1ub amd64 Scientific plotting library (wxWidgets driver)
    ii plplot12-driver-xwin:amd64 5.10.0+dfsg2-0.1ub amd64 Scientific plotting library (X11 driver)

    (naming conventions are not obvious for me ...)

     
    • giloo

      giloo - 2017-11-21

      excellent. So GDL is OK for Ubuntu 17.10, with widgets and graphic widgets, here is a screenshot for atv.

       

Log in to post a comment.