You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes we have very large images which take a long time to transform; we'd like to be able to cancel the transformation if a time limit is reached.
I've tried implementing this using time.After and running the image transformation in a separate goroutine. Then cancelling the goroutine if the timeout is reached; however this causes a runtime error:
No, I don't think that will be possible. The work is taking place in CGo and is performing computations until it completes, so there isn't any way to get its attention, so to speak. Your best bet is probably to use the header methods to inspect the dimensions and decide whether to proceed before starting the transform.
Sometimes we have very large images which take a long time to transform; we'd like to be able to cancel the transformation if a time limit is reached.
I've tried implementing this using
time.After
and running the image transformation in a separate goroutine. Then cancelling the goroutine if the timeout is reached; however this causes a runtime error:Is there a graceful way to cancel a call to ImageOps.Transform?
The text was updated successfully, but these errors were encountered: