本文整理汇总了Python中Image.Image.get_thumb_src方法的典型用法代码示例。如果您正苦于以下问题:Python Image.get_thumb_src方法的具体用法?Python Image.get_thumb_src怎么用?Python Image.get_thumb_src使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image.Image
的用法示例。
在下文中一共展示了Image.get_thumb_src方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: output
# 需要导入模块: from Image import Image [as 别名]
# 或者: from Image.Image import get_thumb_src [as 别名]
def output(id):
'''Renders output page with lightbox image and related photos.
Lightbox title is absent from the page source unless logged into
iStockphoto so making title flat and editable on page'''
file_contents = get_lightbox_source(id)
exp_imgs = re.compile(r"file_thumbview_approve\\\/(\d+)\\\/")
# soup = BeautifulSoup(file_contents)
# title = soup.findAll(id='searchTitleCaption')
# matches = re.search(r'\| Lightbox: ([\b\w\s\b]+) ', file_contents)
ubbstr = ''
thumbs = []
# if matches:
# name = matches.group(1)
# else:
# name = soup.title #'Lightbox Name Goes Here'
ids = exp_imgs.findall(file_contents)
ids = list(set(ids)) # dedupe
for image_id in ids:
i = Image(None, None, None, image_id)
ubbstr += i.get_ubb_string() + ' '
thumbs.append({
'id' : image_id,
'src' : i.get_thumb_src(),
'ubb' : i.get_ubb_string()
})
return render_template('output.html', id=id, name='Lightbox', thumbs=thumbs, ubbstring=ubbstr)