Abort loading image

Mar 7, 2014 at 8:20 PM
For a thumbnail browser I have a custom thumbnail control where each loads an image in different Task.Factory thread. Is there a way to stop Magick once it starts loading and working on image.thumbnail(100,100) when user switches the folder? For some huge images it takes really long time. Cancelation token would not do anything and I don't know what kind of thread termination Magick is OK with.
Also, does it make sense to use threads or async/await would be better?
Mar 7, 2014 at 11:01 PM
You should not abort a thread that is loading an image. This can cause problems with the unmanaged memory and temporary files that are being used by ImageMagick. You should probably just finish loading the image and discard (and dispose) it.
Mar 9, 2014 at 7:46 PM
OK thanks! I will then just check if filesize is too large and skip huge images.