+ imgname_s = os.path.join(self._image_dir, imgname_s)
+
+ geom = self._get_png_geom(imgname_s)
+ if geom:
+ w = geom[0]
+ h = geom[1]
+ print self._fig_start("", styles, width=w, height=h)
+ else:
+ print self._fig_start("", styles)
+ print self._anchored_fig(imgname, str_title, imgname_s)
+ print self._fig_end(str_title, styles);
+
+ dic = self.index("figs")
+ dic.append(imgname)
+ if imgname_s != "":
+ dic.append(imgname_s)
+
+ def _photo(self, line):
+ try:
+ str_title = re.search(ur"^☆(写真.*)$", line).group(1)
+ except AttributeError:
+ str_title = ""
+ if str_title.find(u"写真*") == 0:
+ str_title = str_title.replace(u"写真*", "")
+ line = self.input_iter.next()
+ styles = []
+ if line.find("@") == 0:
+ styles = line.strip().replace("@", "").split(",")
+ line = self.input_iter.next()
+
+ imgname = ""
+ imgname_s = ""
+ hash = ""
+ hash_s = ""
+ match_o1 = re.search(ur"<([^,]*?)>", line)
+ match_o2 = re.search(ur"<(.*?),\s*(.*?)>", line)
+ if not match_o1 == None:
+ imgname = match_o1.group(1)
+ imgname = os.path.join(self._image_dir, imgname)
+ imgname_s = re.sub(r"(.[A-Za-z0-9_]+)$", r"_s\1", imgname)
+ elif not match_o2 == None:
+ imgname = match_o2.group(1)
+ imgname = os.path.join(self._image_dir, imgname)
+ imgname_s = match_o2.group(2)
+ imgname_s = os.path.join(self._image_dir, imgname_s)