'Validate thumbs archive.
Confirm existence of thumbs archive, or create if absent.
Confirm stored thumb_width matches current opts.thumb_width,
or invalidate archive.
generate_thumbnails() writes current thumb_width to archive.
Inputs:
opts.thumb_width (float): requested thumb_width
thumbs_path (file): existing thumbs archive
Outputs:
thumbs_path (file): new (non_existent or invalidated), or
validated existing thumbs archive'

def confirm_thumbs_archive(self):

    if self.opts.generate_descriptions:
        if (not os.path.exists(self.cache_dir)):
            self.opts.log.info(("        creating    new    thumb    cache    '%s'" % self.cache_dir))
            os.makedirs(self.cache_dir)
        if (not os.path.exists(self.thumbs_path)):
            self.opts.log.info(('        creating    thumbnail    archive,    thumb_width:    %1.2f"' % float(self.opts.thumb_width)))
            with ZipFile(self.thumbs_path, mode='w') as zfw:
                zfw.writestr('Catalog    Thumbs    Archive', '')
        else:
            try:
                with ZipFile(self.thumbs_path, mode='r') as zfr:
                    try:
                        cached_thumb_width = zfr.read('thumb_width')
                    except:
                        cached_thumb_width = '-1'
            except:
                os.remove(self.thumbs_path)
                cached_thumb_width = '-1'
            if (float(cached_thumb_width) != float(self.opts.thumb_width)):
                self.opts.log.warning(("        invalidating    cache    at    '%s'" % self.thumbs_path))
                self.opts.log.warning(('        thumb_width    changed:    %1.2f"    =>    %1.2f"' % (float(cached_thumb_width), float(self.opts.thumb_width))))
                with ZipFile(self.thumbs_path, mode='w') as zfw:
                    zfw.writestr('Catalog    Thumbs    Archive', '')
            else:
                self.opts.log.info(('        existing    thumb    cache    at    %s,    cached_thumb_width:    %1.2f"' % (self.thumbs_path, float(cached_thumb_width))))
