-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Progress indication when writing multiple frames #7433
Comments
Could you give an example of the pixel size and number of frames in the scenarios that you're dealing with, and how long it is taking you to save in a particular format? Also, be aware that GIF and APNG do not simply process each image and then finish - first they loop through the images to try and determine the differences between one frame and the next, and then there is a second loop writing the images. So measuring progress won't be completely simple.
This might be minor, but if I'm understanding you correctly, it sounds like you're combining multiple files and saving them as one. Pillow doesn't store the filenames of the images that it opens, meaning that when saving, it doesn't know the filename of any files, except for the one being created. |
For example, converting a single 123-frame 400x700px GIF file to WebP [
I imagine it should be either "keep track of the loop which usually takes up most of the duration", or "have one more parameter in the callback/log output to indicate the step" (…or you can pass
…This statement doesn't seem to be entirely correct. (…Although come to think of it, it's probably a better idea to print the filename of the file currently being processed, rather than always the 1st one; and if the filename is not available, something like |
Oh, right, sorry, I was just looking at the code for Image, not ImageFile. |
I've created PR #7435 to resolve this. I haven't included logging as you suggested - Pillow has some, but not much, logging, and given that it is mostly not present, I would rather not add to it. This shouldn't stop you from running your own logging in the callback function though. |
Processing all frames of an animated image file (i.e. GIF, APNG, WebP) can take a while, and there's no indication of any sort for progress there, nor is there any way to keep track of it. Thus, I suggest adding to
save_all
implementation at least one of the following:INFO
orDEBUG
level) after every frame (e.g. the way it's done byconvert -verbose
)n_frames
&filename
of the first file as well); this can be used for customizing log output or for GUI progress indicationThe text was updated successfully, but these errors were encountered: