資源簡介
GIMP 2.6 圖像 處理 軟件
代碼片段和文件信息
#!/usr/bin/env?python
#???Gimp-Python?-?allows?the?writing?of?Gimp?plugins?in?Python.
#???Copyright?(C)?2003?2005??Manish?Singh?
#
#???This?program?is?free?software;?you?can?redistribute?it?and/or?modify
#???it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
#???the?Free?Software?Foundation;?either?version?2?of?the?License?or
#???(at?your?option)?any?later?version.
#
#???This?program?is?distributed?in?the?hope?that?it?will?be?useful
#???but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
#???MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
#???GNU?General?Public?License?for?more?details.
#
#???You?should?have?received?a?copy?of?the?GNU?General?Public?License
#???along?with?this?program;?if?not?write?to?the?Free?Software
#???Foundation?Inc.?59?Temple?Place?-?Suite?330?Boston?MA?02111-1307?USA.
import?string
import?struct
import?inspect
import?os.path
import?gimp
from?gimpfu?import?*
gettext.install(“gimp20-python“?gimp.locale_directory?unicode=True)
(CHARS_SOURCE?CHARS_FILE?CHARS_PARAMETER)?=?range(3)
escape_table?=?{
????‘&‘:?‘&‘
????‘<‘:?‘<‘
????‘>‘:?‘>‘
????‘“‘:?‘"‘
}
style_def?=?“““body?{
???width:?100%%;
???font-size:?%dpx;
???background-color:?#000000;
???color:?#ffffff;
}
“““
preamble?=?“““???????????????????“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
tle>CSS?Color?XHTML?written?by?GIMP tle>
%s
ta?http-equiv=“Content-Type“?content=“text/html;?charset=utf-8“?/>
“““
postamble?=?“““\n
\n\n\n“““
def?colorxhtml(img?drawable?filename?raw_filename
???????source_type?characters?size?separate):
????width?=?drawable.width
????height?=?drawable.height
????bpp?=?drawable.bpp
????if?not?drawable.is_rgb?or?drawable.has_alpha:
????????return
????gimp.tile_cache_ntiles(width?/?gimp.tile_width()?+?1)
????html?=?file(filename?‘w‘)
????if?separate:
????????dirname?cssfile?=?os.path.split(filename)
????????cssfile?=?os.path.splitext(cssfile)[0]?+?‘.css‘
????????cssname?=?os.path.join(dirname?cssfile)
????????css?=?file(cssname?‘w‘)
????if?source_type?==?CHARS_SOURCE:
????????chars?=?file(inspect.getsourcefile(colorxhtml)).read()
????elif?source_type?==?CHARS_FILE:
????????chars?=?file(characters).read()
????elif?source_type?==?CHARS_PARAMETER:
????????chars?=?characters
????allchars?=?string.maketrans(‘‘?‘‘)
????goodchars?=?string.digits?+?string.ascii_letters?+?string.punctuation
????badchars?=?‘‘.join([c?for?c?in?allchars?if?c?not?in?goodchars])
????chars?=?chars.translate(allchars?badchars)
????data?=?[]
????for?c?in?chars:
????????data.append(escape_table.get(c?c))
????if?data:
????????data.reverse()
????else:
????????data?=?list(‘X‘?*?80)
????pr?=?drawable.get_pixel_rgn(0?0?width?height?False?False)
????gimp.progress_init(_(“Saving?as?colored?XHTML“))
????style?=?style_def?%?size
????i
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????I.A....???????959??2010-07-05?02:25??GIMP2\etc\fonts\conf.d\README
????I.A....??????6694??2010-02-17?17:12??GIMP2\Python\Lib\lib2to3\Grammar.txt
????I.A....???????821??2008-04-02?11:56??GIMP2\Python\Lib\lib2to3\PatternGrammar.txt
????I.A....???????121??2005-10-28?19:07??GIMP2\Python\Lib\site-packages\README.txt
????I.A....??????1122??2006-04-18?09:57??GIMP2\Python\Lib\test\leakers\README.txt
????I.A....?????31278??2009-10-01?08:10??GIMP2\share\gimp\2.0\help\zh_CN\become-a-gimp-wizard.html
????I.A....?????45756??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\bibliography.html
????I.A....??????3400??2009-10-01?08:10??GIMP2\share\gimp\2.0\help\zh_CN\common-sc
????I.A....??????4622??2009-10-01?08:10??GIMP2\share\gimp\2.0\help\zh_CN\customize-splashscreen.html
????I.A....??????9377??2009-10-01?08:10??GIMP2\share\gimp\2.0\help\zh_CN\dialogs.html
????I.A....??????4823??2009-10-01?08:10??GIMP2\share\gimp\2.0\help\zh_CN\file-print-gtk.html
????I.A....??????7511??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-alpha-to-logo.html
????I.A....??????7655??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-animation.html
????I.A....??????3493??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-artistic.html
????I.A....?????10002??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-blur.html
????I.A....??????3479??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-combine.html
????I.A....??????3635??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-decor.html
????I.A....??????3817??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-distort.html
????I.A....??????4871??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-edge.html
????I.A....??????3615??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-enhance.html
????I.A....??????4111??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-generic.html
????I.A....??????4708??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-light-and-shadow.html
????I.A....??????3860??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-map.html
????I.A....??????3802??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-noise.html
????I.A....??????3901??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-render.html
????I.A....??????4007??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters-web.html
????I.A....?????37174??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\filters.html
????I.A....??????5079??2009-10-01?08:10??GIMP2\share\gimp\2.0\help\zh_CN\font-problems.html
????I.A....?????11397??2009-10-01?08:10??GIMP2\share\gimp\2.0\help\zh_CN\getting-started.html
????I.A....??????9212??2009-10-01?08:11??GIMP2\share\gimp\2.0\help\zh_CN\gfdl-1.html
............此處省略5811個文件信息
評論
共有 條評論