guetzli icon indicating copy to clipboard operation
guetzli copied to clipboard

Progress/cancellation

Open loganhope560 opened this issue 6 years ago • 5 comments

Is there any way when using Guetzli as a library to insert checkpoints where one could check an early exit flag and abort the compression operation? Thanks.

loganhope560 avatar Jul 31 '17 19:07 loganhope560

At what points you do think early exits would make sense

On 31 Jul 2017 23:19, "loganhope560" [email protected] wrote:

Is there any way when using Guetzli as a library to insert checkpoints where one could check an early exit flag and abort the compression operation? Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/guetzli/issues/229, or mute the thread https://github.com/notifications/unsubscribe-auth/ARp_YcnIT1qaMHbT-UgvhpJZePeJjC6Eks5sTiimgaJpZM4Oozt6 .

khavishbhundoo avatar Jul 31 '17 20:07 khavishbhundoo

I don't know anything about the algorithm(s) that Guetzli uses. What I'm asking is if there exist any natural "rounds" or such where a callback could be made and the callback could decide to free the resources associated with the operation.

loganhope560 avatar Jul 31 '17 20:07 loganhope560

Yes, guetzli is an iterative algorithm so earlier abort (with larger/less optimized result) is possible.

kornelski avatar Jul 31 '17 21:07 kornelski

Thanks, pornel. Do you happen to have any pointers on how I might hook that in? Currently I am using a single call to guetzli::Process.

loganhope560 avatar Jul 31 '17 21:07 loganhope560

Look for stop_early variables in the code. You'll need to hook them up (or another variable in similar places) to whatever mechanism you want to use for stopping.

kornelski avatar Jul 31 '17 22:07 kornelski