This sounded like a fun problem so I have whipped up a script which seems to do the trick. Instructions: 1) install the Python scripting language: http://www.python.org 2) copy the text below (between but not including the 'start script' and 'end script' lines) into a file and save it as 'mapmatcher.py' 3) open a command window and run 'python mapmatcher.py *.map' (You might need to specify the directory that python was installed in) It will (I think) list groups of files which differ only by rotation Good luck! ----start script--- # Usage: python mapmatcher.py *.map import sys import re rgb_re = re.compile(r'\s*(\d+)\s+(\d+)\s+(\d+)') def build_list(mapfile): colorlist = [] solid = (0,0,0,255) for line in mapfile: m = rgb_re.match(line) if m != None: (r,g,b) = (min(255, int(m.group(1))), min(255, int(m.group(2))), min(255, int(m.group(3)))) colorlist.append((r,g,b)) return colorlist def rotate_list_by(l,n): return l[n:] + l[:n] sets = {} for f in sys.argv[1:]: l = build_list(open(f)) min_list = l for i in xrange(len(l)): rotated_list = rotate_list_by(l,i) if rotated_list < min_list: min_list = rotated_list # min_list is now the canonical rotation # convert the list to a string since lists can't be used as # hash keys key = "%s" % min_list # add the filename to a hash indexed by the rotated list sets.setdefault(key, []).append(f) for (k,v) in sets.items(): if len(v) > 1: # some dups print "These files contain the same map:" print "\n".join(v) ----end script--- On Sun, 2007-10-28 at 14:43 -0500, Paul N. Lee wrote:
David M Fisher wrote:
The best solution would be a program which first would enter place holders within the map file so that all maps would be uniform, then run a comparison for sequence of RGB values regardless of place.
This is a really great idea!!
But, as Jonathan already mentioned, it would not have any effect on the thousands of .MAP files that already exist. And with so many already available, no way to easily create a utility to update the older files, even if this was implemented today. And it would mean that all of the other applications that can use FractInt .MAP files would also need to be modified by their author's (and that is several programs).
Too bad this had not been in place within FractInt at least 15 (or more) years ago.
I wonder how many map files on people's drives are actually duplicates, with the only difference being sequence?
In some instances, probably quite a few.
Sincerely, P.N.L. ------------------------------------------------- http://home.att.net/~Paul.N.Lee/PNL_Fractals.html http://www.Nahee.com/Fractals/
_______________________________________________ Fractint mailing list Fractint@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/fractint