def get_rendition_or_not_found(image, specs):
 try:
  return image.get_rendition(specs)
 except SourceImageIOError:
  Rendition = image.renditions.model
  rendition = Rendition(image=image, width=0, height=0)
  rendition.file.name = u'not-found'
  return rendition

def get_rendition_or_not_found ( image , specs ) : try : return image . get_rendition ( specs ) except SourceImageIOError : Rendition = image . renditions . model rendition = Rendition ( image = image , width = 0 , height = 0 ) rendition . file . name = u'not-found' return rendition
tries to get / create the rendition for the image or renders a not-found image if it does not exist .