mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-21 05:31:30 +02:00
Removed superfluous lopen builtin
This commit is contained in:
@@ -412,7 +412,7 @@ class Reader(FormatReader):
|
||||
for col in row:
|
||||
if col not in images:
|
||||
raise Exception('Image with uid: %s missing.' % col)
|
||||
w, h = identify(lopen('%s.jpg' % col, 'rb'))[1:]
|
||||
w, h = identify(open('%s.jpg' % col, 'rb'))[1:]
|
||||
row_width += w
|
||||
if col_height < h:
|
||||
col_height = h
|
||||
@@ -427,14 +427,14 @@ class Reader(FormatReader):
|
||||
x_off = 0
|
||||
largest_height = 0
|
||||
for col in row:
|
||||
im = image_from_data(lopen('%s.jpg' % col, 'rb').read())
|
||||
im = image_from_data(open('%s.jpg' % col, 'rb').read())
|
||||
canvas.compose(im, x_off, y_off)
|
||||
w, h = im.width(), im.height()
|
||||
x_off += w
|
||||
if largest_height < h:
|
||||
largest_height = h
|
||||
y_off += largest_height
|
||||
with lopen('%s.jpg' % uid) as out:
|
||||
with open('%s.jpg' % uid) as out:
|
||||
out.write(canvas.export(compression_quality=70))
|
||||
self.log.debug('Wrote composite image with uid %s to images/%s.jpg' % (uid, uid))
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user