Esempio n. 1
0
def ajax_screenshot(request,url):
    if request.method=='POST':
        try:
            thumbnail = get_thumbnail(url, '400x400')
            status='Success'
            #thumbnail = get_object_or_404(WebpageSnapshot, url=url)
            print "image.url===================",str(thumbnail)
            message=[url,str(thumbnail)]
        except:
            status='Fail'
            message=[url,'errors:the image capture errors!']
        return simplejson.dumps({'status':status,'message':message})
Esempio n. 2
0
 def get_thumbnail(self):
     if self.get_crop():
         return get_thumbnail(self.get_url(), self.get_geometry_string())
     else:
         return get_thumbnail(self.get_url(), self.get_geometry_string(),
             crop='')