예제 #1
0
        private static void CompareHashes(bool debug = false)
        {
            Sames = CompareUtils.CompareImages(Cache);

            if (debug)
            {
                var strm = new StreamWriter(new FileInfo("same.txt").OpenWrite());

                foreach (var p in Sames)
                {
                    strm.WriteLine(p.First + ":=" + p.Last);
                }

                strm.Close();
            }
        }
예제 #2
0
        private static int LoadCachedFiles(string cachefile = "cache.hash")
        {
            Cache = new HashCache(new FileInfo(cachefile));

            int iters = CompareUtils.LoadImageHashes(RelDir, Cache);

            foreach (string file in Cache.Filenames)
            {
                var fulf = Path.GetFullPath(Path.Combine(RelDir, file));

                if (!new FileInfo(fulf).Exists)
                {
                    Cache.RemoveFile(file);
                }
            }

            Cache.WriteCache();

            return(iters);
        }