(self, failed_pages, attr, error_msg=None)
If in duplex mode, this function will copy the given attribute
        from the image that defines it over to the one that does not.
        ie. if the attribute is None in one and differently in the other image
        it is copied.
If in duplex mode, this function will copy the given attribute
        from the image that defines it over to the one that does not.
        ie. if the attribute is None in one and differently in the other image
        it is copied.
If in duplex mode this function will copy the given attribute from the image that defines it over to the one that does not . ie . if the attribute is None in one and differently in the other image it is copied .
def duplex_copy_image_attr(self, failed_pages, attr, error_msg=None):
        """If in duplex mode, this function will copy the given attribute
        from the image that defines it over to the one that does not.
        ie. if the attribute is None in one and differently in the other image
        it is copied.

        """

        i = 0
        while i < len(self.obj.images):
            failed = (i in failed_pages or i + 1 in failed_pages)

            first = self.obj.images[i]
            second = self.obj.images[i + 1]

            if getattr(first, attr) is None and getattr(second, attr) is None:
                if error_msg is not None and not failed:
                    log.warn(error_msg % (first.filename, first.tiff_page + 1, second.filename, second.tiff_page + 1))
            elif getattr(first, attr) is None:
                setattr(first, attr, getattr(second, attr))
            elif getattr(second, attr) is None:
                setattr(second, attr, getattr(first, attr))

            i += 2
def duplex_copy_image_attr ( self , failed_pages , attr , error_msg = None ) : i = 0 while i < len ( self . obj . images ) : failed = ( i in failed_pages or i + 1 in failed_pages ) first = self . obj . images [ i ] second = self . obj . images [ i + 1 ] if getattr ( first , attr ) is None and getattr ( second , attr ) is None : if error_msg is not None and not failed : log . warn ( error_msg % ( first . filename , first . tiff_page + 1 , second . filename , second . tiff_page + 1 ) ) elif getattr ( first , attr ) is None : setattr ( first , attr , getattr ( second , attr ) ) elif getattr ( second , attr ) is None : setattr ( second , attr , getattr ( first , attr ) ) i += 2