OpenJPEG library error

Sentinel-2 Level 2A Prototype Processor (Sen2Cor), 2.3.0, created: 2016.11.18 started …
selected resolution is 60 m.
Progress[%]: 1.38 : PID-7508, L2A_ProcessTile: processing with resolution 60 m, elapsed time[s]: 1.878
Progress[%]: 1.38 : PID-7508, L2A_ProcessTile: start of pre processing, elapsed time[s]: 0.000
Progress[%]: 1.41 : PID-7508, L2A_Tables: start import, elapsed time[s]: 0.031
Progress[%]: 2.05 : PID-7508, L2A_Tables: band B01 imported, elapsed time[s]: 0.873
Progress[%]: 19.37 : PID-7508, L2A_Tables: band B02 imported, elapsed time[s]: 23.527
Progress[%]: 37.31 : PID-7508, L2A_Tables: band B03 imported, elapsed time[s]: 24.377
Progress[%]: 56.54 : PID-7508, L2A_Tables: band B04 imported, elapsed time[s]: 26.115
Process L2A_ProcessTile-1:
Traceback (most recent call last):
File “C:\Anaconda2\lib\multiprocessing\”, line 258, in _bootstrap
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\”, line 129, in run
if self.process_60() == False:
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\”, line 147, in process_60
return self.process()
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\”, line 196, in process
if(self.preprocess() == False):
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\”, line 289, in preprocess
if(self.tables.importBandList() == False):
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\”, line 1017, in importBandList
res = self.importBand(i, os.path.join(sourceDir, filename))
File “C:\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor\”, line 1643, in importBand
fullRes = indataset[:]
File “C:\Anaconda2\lib\site-packages\glymur\”, line 1043, in getitem
return self._read()
File “C:\Anaconda2\lib\site-packages\glymur\”, line 1131, in _read
img = self._read_openjp2(**kwargs)
File “C:\Anaconda2\lib\site-packages\glymur\”, line 1333, in _read_openjp2
opj2.decode(codec, stream, raw_image)
File “C:\Anaconda2\lib\site-packages\glymur\lib\”, line 647, in decode
OPENJP2.opj_decode(codec, stream, image)
File “C:\Anaconda2\lib\site-packages\glymur\lib\”, line 598, in check_error
raise OpenJPEGLibraryError(msg)
OpenJPEGLibraryError: OpenJPEG library error: Stream too short, expected SOT
OpenJPEG library error: Failed to decode tile 2/81
OpenJPEG library error: Failed to decode the codestream in the JP2 file

1 Like

I have the same error.

OpenJPEGLibraryError: OpenJPEG library error: Tile part length size inconsistent with stream lengthOpenJPEG library error: Failed to decode the codestream in the JP2 file

Any ideas how to fix this?


Get same error. Not on all scenes. I am using recompiled openjp2.dll from August 31, 2017 Anaconda release.

I also got the same error while processing a set of ~30 S2 images. Anaconda processed the first 12 and then gave me this error. I tried a second time, but again it processed the same 13 images of before.
Curiously enough, I took out of the folder the 13 images that had been processed, launched again the L2A_Process and this time it started processing the other ones…could it be that there is some sort of maximum number of images that can be processed before everything crashes?