示例#1
0
 def import_logo(tree):
     logo = find_text(tree, 'logo')
     if logo:
         image = ImageImporter(logo)
         image.get_image()
         return image.to_base64()
     return None
示例#2
0
 def import_logo(tree):
     logo = find_text(tree, 'logo')
     if logo:
         image = ImageImporter(logo)
         image.get_image()
         return image.to_base64()
     return None
示例#3
0
 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()))
示例#4
0
 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()
             )
         )