Using os.path.getsize instead of os.stat
This commit is contained in:
parent
c35bcaead0
commit
34b45ba822
2 changed files with 3 additions and 4 deletions
|
|
@ -73,7 +73,7 @@ class Jp2kBox(object):
|
|||
self.offset = offset
|
||||
self.longname = longname
|
||||
|
||||
# should never be used except for last box in file.
|
||||
# should never be used except maybe for last box in file.
|
||||
self._file_size = -1
|
||||
|
||||
def __str__(self):
|
||||
|
|
|
|||
|
|
@ -118,9 +118,8 @@ class Jp2k(Jp2kBox):
|
|||
IOError
|
||||
The file was not JPEG 2000.
|
||||
"""
|
||||
stat = os.stat(self.filename)
|
||||
self.length = stat.st_size
|
||||
self._file_size = stat.st_size
|
||||
self.length = os.path.getsize(self.filename)
|
||||
self._file_size = os.path.getsize(self.filename)
|
||||
|
||||
with open(self.filename, 'rb') as fptr:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue