[GRASS-dev] [GRASS GIS] #3600: m.nviz.image doesn't produce any output

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by hellik):

* Attachment "mnviz_ppm.txt" added.

winGRASS DEBUG=3 ppm

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by hellik):

* Attachment "mnviz_tif.txt" added.

winGRASS DEBUG=3 tif

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by hellik):

Replying to [comment:18 hellik]:
> Replying to [comment:13 hcho]:
> > I think that this issue is platform dependent.
>
> what I get in winGRASS

some other (maybe) related tickets:

#2114
#2175
#2175
#2998
#3041

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:19&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by hcho):

Hmm...

{{{
TIFFOpen: D:\temp\mnviz\test\elev.tif: No such file or directory.
}}}

TIFFOpen cannot create a new file? Permission or that folder doesn't
exist?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:20&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by hcho):

Please try r72948.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:21&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by hellik):

Replying to [comment:20 hcho]:
> Hmm...
>
> {{{
> TIFFOpen: D:\temp\mnviz\test\elev.tif: No such file or directory.
> }}}
>
> TIFFOpen cannot create a new file? Permission or that folder doesn't
exist?
>
> I think this issue is different from the original one. He was able to
write out an output file with just the header. I think you'll be able to
see the original issue once you fix this TIFFOpen issue.

there is no permission issue as other winGRASS modules are able to write
to this folder.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:22&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by hcho):

Interesting... What is errno after fopen in lib/ogsf/gsd_img_ppm.c?

In GS_write_zoom,
{{{
#include <errno.h>

...

if (NULL == (fp = fopen(name, "w"))) {
    fprintf(stderr, "errno %d\n", errno);
    G_warning(...);
    return (1);
}
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:23&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by cmbarton):

Replying to [comment:16 hcho]:
> Or in your m.nviz.image command, change {{{size=500,500}}} to
{{{size=512,512}}}.

I just did this and it gives the same result, an image file with header
but no content. Same output message too.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:24&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by hcho):

Replying to [comment:24 cmbarton]:
> Replying to [comment:16 hcho]:
> > Or in your m.nviz.image command, change {{{size=500,500}}} to
{{{size=512,512}}}.
>
> I just did this and it gives the same result, an image file with header
but no content. Same output message too.

What about changing {{{GL_TEXTURE_2D}}} to {{{GL_TEXTURE_RECTANGLE_EXT}}}
in lib/nviz/render.c? You're on MacOS, right?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:25&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by cmbarton):

If I do that, I'll need to recompile. I'm at home today due to the
holiday. I could try this once I'm back in my office.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:26&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by guano):

I made the changes to render.c:

{{{
aglCreatePBuffer(width, height, GL_TEXTURE_RECTANGLE_EXT, GL_RGBA, 0,
&(rwin->windowId));
if (aglCreatePBuffer(width, height, GL_TEXTURE_RECTANGLE_EXT, GL_RGBA, 0,
&(rwin->windowId)) == GL_FALSE)
fprintf(stderr, "aglCreatePBuffer failed: %d %d %d\n", width, height,
aglGetError());
}}}

and tried to run with {{{size=500,500}}} and {{{size=512,512}}}

the result is the same, as well as the error message:

{{{aglCreatePBuffer failed: 500 500 10005}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:27&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by hellik):

Replying to [comment:21 hcho]:
> Please try r72948.

tested with

{{{
GRASS version: 7.5.svn
GRASS SVN revision: r72959
Build date: 2018-07-06
Build platform: x86_64-w64-mingw32
GDAL: 2.2.4
PROJ.4: 4.9.3
GEOS: 3.5.0
SQLite: 3.17.0
Python: 2.7.14
wxPython: 2.8.12.1
Platform: Windows-10-10.0.17134 (OSGeo4W)
}}}

ppm and tif can't be opened.

DEBUG=3 output of the cmd, tif and ppm attached

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:28&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by hellik):

* Attachment "winGRASS_mnviz_image_tif.txt" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by hellik):

* Attachment "winGRASS_mnviz_image_ppm.txt" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by hellik):

* Attachment "elev_winGRASS.ppm" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by hellik):

* Attachment "elev_winGRASS.tif" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by hcho):

Replying to [comment:28 hellik]:
> Replying to [comment:21 hcho]:
> > Please try r72948.
>
> tested with
>
> {{{
> GRASS version: 7.5.svn
> GRASS SVN revision: r72959
> Build date: 2018-07-06
> Build platform: x86_64-w64-mingw32
> GDAL: 2.2.4
> PROJ.4: 4.9.3
> GEOS: 3.5.0
> SQLite: 3.17.0
> Python: 2.7.14
> wxPython: 2.8.12.1
> Platform: Windows-10-10.0.17134 (OSGeo4W)
> }}}
>
> ppm and tif can't be opened.
>
> DEBUG=3 output of the cmd, tif and ppm attached

Hmm... The size of the ppm is 6618224*0. OK, glViewport never gets called
unless you resize the viewport. I think omitting glViewport is
implementation dependent. Please try the attached patch
(lib/nviz/render.c).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:29&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------
Changes (by hcho):

* Attachment "lib-nviz-render.c.diff" added.

Test patch for lib/nviz/render.c (call glViewport)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by hellik):

Replying to [comment:29 hcho]:
> Replying to [comment:28 hellik]:
> > Replying to [comment:21 hcho]:
> > > Please try r72948.
> >
> > tested with
> >
> > {{{
> > GRASS version: 7.5.svn
> > GRASS SVN revision: r72959
> > Build date: 2018-07-06
> > Build platform: x86_64-w64-mingw32
> > GDAL: 2.2.4
> > PROJ.4: 4.9.3
> > GEOS: 3.5.0
> > SQLite: 3.17.0
> > Python: 2.7.14
> > wxPython: 2.8.12.1
> > Platform: Windows-10-10.0.17134 (OSGeo4W)
> > }}}
> >
> > ppm and tif can't be opened.
> >
> > DEBUG=3 output of the cmd, tif and ppm attached
>
> Hmm... The size of the ppm is 6618224*0. OK, glViewport never gets
called unless you resize the viewport. I think omitting glViewport is
implementation dependent. Please try the attached patch
(lib/nviz/render.c).

No chance to build winGRASS here in the next days; submitting to trunk?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:30&gt;
GRASS GIS <https://grass.osgeo.org>

#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter: guano | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Default | Version: 7.0.4
Resolution: | Keywords:
       CPU: Unspecified | Platform: MacOSX
--------------------------+-------------------------

Comment (by cmbarton):

I'd like to test on the Mac if I can get trunk to compile without errors.
I'll try again with a fresh checkout when I'm back at my office computers
this coming week.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:31&gt;
GRASS GIS <https://grass.osgeo.org>