예제 #1
0
파일: ajax.py 프로젝트: jerryxing98/Tully
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})
예제 #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='')