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

Report progress during batch processing #83

Open
mundodisco8 opened this issue Mar 7, 2024 · 2 comments
Open

Report progress during batch processing #83

mundodisco8 opened this issue Mar 7, 2024 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@mundodisco8
Copy link

Hi,

I've been playing with the module and so far it's proven to be really useful, thanks for your work.

I'm renaming some files based on their date of creation. Sometimes, I have to process folders with a couple thousand files. I used to do a "for file in files: process(file)" but that took hours, and found that ExifTool is capable of doing batch processing itself, WAY FASTER (minutes), so I use the execute_json to do the batch processing for me.

Nevertheless, it still takes minutes, and was wondering if there's a way to report progress during processing, or at least an "spinner".

@sylikc
Copy link
Owner

sylikc commented Jun 19, 2024

So, currently PyExifTool doesn't support any type of progress. I could envision doing something like a callback to dump out the os.read() somewhere... but I'm not necessarily sure this would be helpful to the caller.

while not _get_buffer_end(output_list, endswith_count).strip().endswith(b_endswith):
if constants.PLATFORM_WINDOWS:
# windows does not support select() for anything except sockets
# https://docs.python.org/3.7/library/select.html
output_list.append(os.read(fd, block_size))
else: # pytest-cov:windows: no cover
# this does NOT work on windows... and it may not work on other systems... in that case, put more things to use the original code above
inputready, outputready, exceptready = select.select([fd], [], [])
for i in inputready:
if i == fd:
output_list.append(os.read(fd, block_size))

The issue is that the os.read() is given raw bytes back. These are neither decoded, nor does pyexiftool know exactly how much data is supposed to be returned.

If we could come up with something that might be useful, it could be implemented. As it stands, it's a bit difficult to find a good implementation that has a general use case

@sylikc sylikc added enhancement New feature or request question Further information is requested labels Jun 19, 2024
@mantered
Copy link

exiftool has a "-progress" flag, could that be used to report back some progress?
At the moment I'm using the exiftool command and pipe the progress to the terminal,
since PyExifTool has no progress report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants