Reputation: 417
I am trying to do some work with BlenderGIS.
Specifically, i am painfully debugging the addon to use Gdal, and add support to more files.
Right now, i am trying to open a .jp2 file (jpeg2000).
I opened my CLI in the same folder as blender, using its python.exe. To try to make sure i use the same dependencies, everything.
In my cli, i can run these three lines:
>>> path = 'C:\\Users\\Me\\Documents\\PIA\\Cartes\\ORTHOHR_1-0_RVB-0M20_JP2-E080_LAMB93_D02A_2021-01-01\\ORTHOHR\\1_DONNEES_LIVRAISON_2023-09-00007\\OHR_RVB_0M20_JP2-E080_LAMB93_D2A-2021\\2A-2021-1160-6110-LA93-0M20-E080.jp2'
>>> ds = gdal.Open(path, gdal.GA_ReadOnly)
>>> ds
<osgeo.gdal.Dataset; proxy of <Swig Object of type 'GDALDatasetShadow *' at 0x000001E45EECED30> >
Meaning that it's doing what it's supposed to.
In python, this same bit of code:
(Where self is my file object. self.path is a string, i see it in the debugger)
if self.path is None or not self.fileExists:
raise IOError("Cannot find file on disk")
ds = gdal.Open(self.path, gdal.GA_ReadOnly)
Immediately crashes.
The generated crash.txt file looks like this:
# backtrace
Exception Record:
ExceptionCode : EXCEPTION_ACCESS_VIOLATION
Exception Address : 0x00007FF8A4B43020
Exception Module : MSVCP140.dll
Exception Flags : 0x00000000
Exception Parameters : 0x2
Parameters[0] : 0x0000000000000000
Parameters[1] : 0x0000000000000000
Stack trace:
MSVCP140.dll :0x00007FF8A4B42F10 Thrd_yield
gdal.dll :0x00007FF84F643320 GDALOpenInfo::AreSiblingFilesLoaded
gdal.dll :0x00007FF84F642E50 GDALOpenInfo::GDALOpenInfo
gdal.dll :0x00007FF84F659450 GDALOpenEx
gdal.dll :0x00007FF84F659420 GDALOpen
_gdal.cp311-win_amd64.pyd:0x00007FF88F6A560B Symbols not available
And as far as i know, i can read the dll files being loaded in memory:
0x00007FF88F610000 _gdal.cp311-win_amd64.pyd
0x00007FF84E980000 3.9.2.0 gdal.dll
0x00007FF9AD2F0000 10.0.26100.2605 WLDAP32.dll
0x00007FF8D82E0000 10.0.26100.2454 ODBC32.dll
0x00007FF8682D0000 proj_9_4.dll
0x00007FF891630000 geos_c.dll
0x00007FF88A1D0000 geos.dll
0x00007FF9AA830000 10.0.26100.1 DPAPI.DLL
0x00007FF9432C0000 _gdalconst.cp311-win_amd64.pyd
0x00007FF88CE20000 _ogr.cp311-win_amd64.pyd
0x00007FF88F5A0000 _osr.cp311-win_amd64.pyd
0x00007FF8E29D0000 _gdal_array.cp311-win_amd64.pyd
I opened what i think is the offending file, _gdal.cp311-win_amd64.pyd in Dependencies (A utility to check dependencies of files). And it says python311.dll is missing, which makes no sense because python wouldn't work at all if it was the case right?
It's also present, and in the same folder as python.exe anyway.
I also checked the permissions, which aren't the problem here.
a = os.stat(self.path)
b = oct(a.st_mode)
b
'0o100666'
What can i do about this?
Thanks
Upvotes: 0
Views: 34