'Inherit certain properties from predecessor because it\'s very
convenient. Remember to always call this method before
setting properties :)
A revision may not have a predecessor if the property is unset, it may
be unset if it\'s the initial history entry.'

def inherit_predecessor(self, image, skip_image_file=False):

    predecessor = image.current_revision.imagerevision
    super(ImageRevision, self).inherit_predecessor(image)
    self.plugin = predecessor.plugin
    self.deleted = predecessor.deleted
    self.locked = predecessor.locked
    if (not skip_image_file):
        try:
            self.image = predecessor.image
            self.width = predecessor.width
            self.height = predecessor.height
        except IOError:
            self.image = None
