I am using GoIconicNode that loads images of bmp format that are different sizes from a filepath. For example, I call Initialize(null, filepath, “Test”) on rendering the nodes and all images load fine.
The problem comes when I want to edit one of the images. Whether the web page still has goview loaded or has been closed, the image becomes locked and cannot be edited. I have to kill aspnet_wp.exe process in order to unlock all images that were rendered. Is there something wrong in the way I’m loading the image file or can I call something in code to release the files? Should I be using a resx file in the first place?
The basic issue is that System.Drawing.Image.FromFile locks the file as long as the Image is in use.
I believe (but am not certain) that adding such Images to a ResourceManager would make a copy of the Image. (If that isn't the case, you could certain copy it explicitly.) The original Image could then be Disposed, thereby freeing the lock on the file.