Skip to content

Commit

Permalink
Fixed images not resizing for width exceeding the inital size.
Browse files Browse the repository at this point in the history
  • Loading branch information
rk89gc committed Jan 20, 2021
1 parent be23ab4 commit 25d37e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/openxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def xl(self, children):
self._insert(e)
return e

def picture(self, filename, name='', descr='', cap=627):
def picture(self, filename, name='', descr='', cap=None):
# ext, content_type, relationships
ext = filename.split('.')[-1]
if ext == 'jpg':
Expand Down Expand Up @@ -618,9 +618,8 @@ def picture(self, filename, name='', descr='', cap=627):
im = Image.open(filename)
x, y = im.size
if cap != None:
if x > cap:
y = int(round(float(cap * y) / x))
x = cap
y = int(round(float(cap * y) / x))
x = cap
x = str(x * 9525)
y = str(y * 9525)
e = etree.fromstring('''
Expand Down
7 changes: 5 additions & 2 deletions src/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ class Version(object):
Generate reports based on HP WebInspect, BurpSuite Pro scans,
own custom data, knowledge base and Microsoft Office Word templates.
'''
version = '1.0.4'
date = 'Tue Jan 19 20:42:36 2021'
version = '1.0.5'
date = 'Wed Jan 20 13:38:46 2021'
changelog = '''
''' + version + ''' - ''' + date + '''
- Fixed images not resizing for width exceeding the inital size
1.0.4 - Tue Jan 19 20:42:36 2021
- Fixed HTML support
1.0.3 - Tuesday Jan 12 11:00:00 2021
Expand Down

0 comments on commit 25d37e4

Please sign in to comment.