def import_logo(tree): logo = find_text(tree, 'logo') if logo: image = ImageImporter(logo) image.get_image() return image.to_base64() return None
def _current_image(self): image = ImageImporter(self.activity.current_image()) try: image.get_image() except Exception, e: log( "Error trying to fetch image to project. Image URL: {extra}", dict(rsr_id=self.activity.rsr_id(), internal_id=self.activity.internal_id(), iati_id=self.activity.iati_id(), event=ERROR_IMAGE_UPLOAD, extra=self.activity.current_image()))
def _current_image(self): image = ImageImporter(RVO_DEFAULT_IMAGE) try: image.get_image() except Exception, e: log( "Error trying to fetch image to project. Image URL: {extra}", dict( iati_id=self.activity.iati_id(), event=ERROR_IMAGE_UPLOAD, extra=self.activity.current_image() ) )