def run(self, paths = []):
items = []
for item in SideBarSelection(paths).getSelectedImages():
try:
image_type, width, height = self.getImageInfo(item.path())
items.append('<img src="'+item.pathAbsoluteFromProjectEncoded()+'" width="'+str(width)+'" height="'+str(height)+'">')
except:
items.append('<img src="'+item.pathAbsoluteFromProjectEncoded()+'">')
if len(items) > 0:
sublime.set_clipboard("\n".join(items));
if len(items) > 1 :
sublime.status_message("Items copied")
else :
sublime.status_message("Item copied")
# http://stackoverflow.com/questions/8032642/how-to-obtain-image-size-using-standard-python-class-without-using-external-lib
评论列表
文章目录