Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GExiv2.Metadata open_buf very slow #21

Open
jim-easterbrook opened this issue Oct 31, 2015 · 0 comments
Open

GExiv2.Metadata open_buf very slow #21

jim-easterbrook opened this issue Oct 31, 2015 · 0 comments

Comments

@jim-easterbrook
Copy link

The GExiv2 metadata library can read data from a file or from image data already in memory. The latter method is very slow when using pgi. The following test program reports an elapsed time of about 3 to 4 milliseconds without pgi, 3 to 4 seconds with! I get similar results with Python 2 or Python 3. (The image file is a full resolution JPEG straight from my EOS 100D DSLR.)

Simple test program:

from __future__ import print_function

import time

import pgi
pgi.install_as_gi()
from gi.repository import GObject, GExiv2

with open('/home/jim/Pictures/from_camera/2015/2015_10_20/IMGc0983.JPG', 'rb') as pf:
    image_data = pf.read()
md = GExiv2.Metadata()
start = time.time()
md.open_buf(image_data)
stop = time.time()
print('Elapsed time', stop - start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants