def get_norm_image_size(self):
    if (not self.texture):
        return list(self.size)
    ratio = self.image_ratio
    (w, h) = self.size
    (tw, th) = self.texture.size
    if self.allow_stretch:
        if (not self.keep_ratio):
            return [w, h]
        iw = w
    else:
        iw = min(w, tw)
    ih = (iw / ratio)
    if (ih > h):
        if self.allow_stretch:
            ih = h
        else:
            ih = min(h, th)
        iw = (ih * ratio)
    return [iw, ih]
def get_norm_image_size(self):
    if (not self.texture):
        return list(self.size)
    ratio = self.image_ratio
    (w, h) = self.size
    (tw, th) = self.texture.size
    if self.allow_stretch:
        if (not self.keep_ratio):
            return [w, h]
        iw = w
    else:
        iw = min(w, tw)
    ih = (iw / ratio)
    if (ih > h):
        if self.allow_stretch:
            ih = h
        else:
            ih = min(h, th)
        iw = (ih * ratio)
    return [iw, ih]