tproduit / pic2map

QGIS plugin for camera orientation and interaction between a picture and the map (monoplotting).
22 stars 5 forks source link

Monoplotter -> Orthorectification -> StackTrace (user error no selection) #10

Closed apiszcz closed 4 years ago

apiszcz commented 4 years ago

Thank you for updating this capability, impressive work.

This is a symptom due to the user not selecting a region in the Orthorectification window.

When one selects Monoplotter -> Orthorectification -> (and OMITS to make a selection (purple box)) . A dialog appears 'Continue with the current purple bounding box', (even though no purple box is selected).

If Yes selected then an error stacktrace appears.

Traceback (most recent call last): File "C:/Users/test/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Pic2Map\drapping.py", line 122, in saveOrtho ortho.computeOrtho(self) UnboundLocalError: local variable 'ortho' referenced before assignment

apiszcz commented 4 years ago

A second issue with Orthorectification to Save as Raster. The save process starts and after about 60 seconds QGIS crashes with no messages or dialogs. Is there a log file that might be available to review where Orthorectification is in the save process?

apiszcz commented 4 years ago

I have a stack trace...! Orthorectification -> Monoplotter window, the progress dialog displayed buffered 99%.

An error has occurred while executing Python code: 

OpenGL.error.GLError: GLError( err = 1282, description = b'invalid operation', baseOperation = glPixelStorei, cArguments = (GL_PACK_SWAP_BYTES, 0) ) 
Traceback (most recent call last):
  File "C:/Users/testuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Pic2Map\monoplotterMainWindow.py", line 794, in getOrtho
    self.saveXYZmatrix()
  File "C:/Users/testuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Pic2Map\monoplotterMainWindow.py", line 566, in saveXYZmatrix
    zMat = glReadPixels(0, 0, self.qgl_window.viewport[2], self.qgl_window.viewport[3], GL_DEPTH_COMPONENT, GL_FLOAT);
  File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\site-packages\OpenGL\GL\images.py", line 358, in glReadPixels
    array = imageData = images.SetupPixelRead( format, (width,height), type )
  File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\site-packages\OpenGL\images.py", line 54, in SetupPixelRead
    setupDefaultTransferMode()
  File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\site-packages\OpenGL\images.py", line 69, in setupDefaultTransferMode
    _simple.glPixelStorei(_simple.GL_PACK_SWAP_BYTES, 0)
  File "C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\site-packages\OpenGL\error.py", line 232, in glCheckError
    baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
    err = 1282,
    description = b'invalid operation',
    baseOperation = glPixelStorei,
    cArguments = (GL_PACK_SWAP_BYTES, 0)
)

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.8.2-Zanzibar Zanzibar, 4470baa1a3 

Python Path:
C:/PROGRA~1/QGIS3~1.8/apps/qgis/./python
C:/Users/testuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/testuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.8/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.8\bin\python37.zip
C:\PROGRA~1\QGIS3~1.8\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib
C:\Program Files\QGIS 3.8\bin
C:\PROGRA~1\QGIS3~1.8\apps\Python37
C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.8\apps\Python37\lib\site-packages\Pythonwin
C:/Users/testuser/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\testuser\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\shapetools\ext-libs
apiszcz commented 4 years ago

The window size was not a divisible by 4. https://www.khronos.org/opengl/wiki/Common_Mistakes Setting the window size to 1024 allowed progress to be made to the Orthorectification window.