python - pyexiv2 get image exif, from_buffer function lead memory leak -
i use pyexiv2 library read image exif info.and found imagemetadata.from_buffer() method lead memory leak when image not intact. imagemetadata() method ok.
the code below test code, , when let read file not image, see memory not free.
import pyexiv2 import time import sys import os def read_metadata(file_data): try: metadata = pyexiv2.imagemetadata(file_data) metadata = pyexiv2.imagemetadata.from_buffer(file_data) metadata.read() except exception,e: print e filename = sys.argv[1] print filename write_metadata(open(filename).read()) time.sleep(10000)
Comments
Post a Comment