Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve speed for ImageListViewCacheMetadata.FromFile() #113

Closed
GoogleCodeExporter opened this issue Jul 28, 2015 · 2 comments
Closed

Improve speed for ImageListViewCacheMetadata.FromFile() #113

GoogleCodeExporter opened this issue Jul 28, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Having a project where I (intentionally) am adding multiple non-existing paths 
to the list view, I get a (caught) exception in

public static ImageMetadata ImageListViewCacheMetadata.FromFile(string path, 
bool useWIC)

Since exceptions have a rather bad performance, I suggest to add one single 
check:

...
FileInfo info = new FileInfo(path);
if( !info.Exists ) { return imageInfo; } // <-- Add this line.
...

This would improve my program performance significantly.

Original issue reported on code.google.com by [email protected] on 12 Nov 2010 at 12:57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants