Esempio n. 1
0
  def _get_size_info(self, opt):
    size = Util.contents(opt)
    link = Util.full_url(opt['value'])
    selected = opt.has_key('selected') and opt['selected'] == 'selected'
    if selected and link == self.page_url + '?g2_imageViewsIndex=0':
      link = self.page_url
    page_soup = Util.get_soup(link)
    img = _get_img_tag(page_soup)

    info = {}
    info['width'], info['height'] = self._get_dimensions(size, img)
    info['page_url'] = link
    info['image_url'] = Util.full_url(img['src'])
    info['is_full_size'] = size == self.full_size
    if info['is_full_size']:
      self.full_size_img_url = info['image_url']
    return info
Esempio n. 2
0
def _get_size(block):
  size_text = Util.contents(block)
  return Util.get_match('([0-9]+x[0-9]+)', size_text)