diff --git a/fpdf/fpdf.py b/fpdf/fpdf.py index e93037dc5..9ee3ab47a 100644 --- a/fpdf/fpdf.py +++ b/fpdf/fpdf.py @@ -1813,10 +1813,11 @@ def _parsejpg(self, filename): f.close() self.error('Missing or incorrect image file: %s. error: %s' % (filename, str(exception()))) - with f: # Read whole file from the start f.seek(0) data = f.read() + f.close() + return {'w':width,'h':height,'cs':colspace,'bpc':bpc,'f':'DCTDecode','data':data} def _parsegif(self, filename):