Closed carfesh closed 4 years ago
Hi,
I will have a look at this when I make the next version! Does your fix work 100%?
For me the fix seems to work 100%; I haven't had a single instance since I fixed it. These exceptions occurred quite frequently, and PhotoSift then only showed an error message in the GUI about not being able to load the image. Just to emphasize it, for me it only happens right after undo operations, when the restored file is attempted to load immediately. Every normal move, copy, etc did not exhibit this for me, or at least I haven't encountered it.
This disappeared completely with that workaround, but it still feels like an ugly hack; I would rather do something like trying to open it, and only if it fails retry it like every 100msec until it either worked or failed after 10 retries or something.
I'm not familiar enough with C# however to implement that myself :(
Glad to hear that you will take a look at it, and thanks BTW for a very useful small tool, I came to appreciate the simpleness for quickly sifting through a bunch of images!
A small update: I had an instance today where the previous workaround still produced an error, as the 100 msec were not sufficient. I went ahead and implemented a workaround that hopefully will work better.
It will now only delay if the image failed to load the first time, and then retry for 10 times. At least I hope that that's what it'll do..
I've committed it here:
https://github.com/carfesh/PhotoSift/commit/b22a4d65c309f5a6ef71de4d36929ba6e8024e4b
Just an update: with that newer fix I could no longer reproduce the error. Current builds of PhotoSift still have this issue, so I would appreciate it if a solution could find its way into the code :)
FYI I have merged your fix into master. There will be a new release soon!
Hi,
for me, when undoing a move operation, I will frequently receive exceptions that the restored file cannot be opened (Win10 1809 with latest patches). I've looked a bit into it, when this happens the console contains output like (sorry for the German language output, don't have an Englisch system at hand right now):
I believe what is happening is that the antivirus is still scanning/thus locking the restored file when PhotoSift attempts to read it (ReadAllBytes).
I've implemented a workaround for this by adding a minor delay after restoring the file, like in the following commit:
https://github.com/carfesh/PhotoSift/commit/92bd192fb2d380235a226575a1a4d0ea6358085a
It's not nice, but for me it seems to work.
Is PhotoSift still being maintained?
If you have a better idea for a proper fix, that would be great; I've thought about implementing a retry mechanism, but I'm not a C# coder..
Kind regards, Torsten