pyexiftool icon indicating copy to clipboard operation
pyexiftool copied to clipboard

Report progress during batch processing

Open mundodisco8 opened this issue 2 years ago • 2 comments

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".

mundodisco8 avatar Mar 07 '24 10:03 mundodisco8

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.

https://github.com/sylikc/pyexiftool/blob/e54f96cd75758096f72bc97c42390f1f9fef8010/exiftool/exiftool.py#L125-L135

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 avatar Jun 19 '24 16:06 sylikc