GIMP 2.6


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 GIMPtle>
%s
ta http-equiv=“Content-Type“ content=“text/html; charset=utf-8“ />



“““

postamble = “““



“““

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  GIMP2etcfontsconf.dREADME

    I.A....      6694  2010-02-17 17:12  GIMP2PythonLiblib2to3Grammar.txt

    I.A....       821  2008-04-02 11:56  GIMP2PythonLiblib2to3PatternGrammar.txt

    I.A....       121  2005-10-28 19:07  GIMP2PythonLibsite-packagesREADME.txt

    I.A....      1122  2006-04-18 09:57  GIMP2PythonLib estleakersREADME.txt

    I.A....     31278  2009-10-01 08:10  GIMP2sharegimp2.0helpzh_CNecome-a-gimp-wizard.html

    I.A....     45756  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNibliography.html

    I.A....      3400  2009-10-01 08:10  GIMP2sharegimp2.0helpzh_CNcommon-script-fu-errors.html

    I.A....      4622  2009-10-01 08:10  GIMP2sharegimp2.0helpzh_CNcustomize-splashscreen.html

    I.A....      9377  2009-10-01 08:10  GIMP2sharegimp2.0helpzh_CNdialogs.html

    I.A....      4823  2009-10-01 08:10  GIMP2sharegimp2.0helpzh_CNfile-print-gtk.html

    I.A....      7511  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-alpha-to-logo.html

    I.A....      7655  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-animation.html

    I.A....      3493  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-artistic.html

    I.A....     10002  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-blur.html

    I.A....      3479  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-combine.html

    I.A....      3635  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-decor.html

    I.A....      3817  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-distort.html

    I.A....      4871  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-edge.html

    I.A....      3615  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-enhance.html

    I.A....      4111  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-generic.html

    I.A....      4708  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-light-and-shadow.html

    I.A....      3860  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-map.html

    I.A....      3802  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-noise.html

    I.A....      3901  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-render.html

    I.A....      4007  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters-web.html

    I.A....     37174  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNfilters.html

    I.A....      5079  2009-10-01 08:10  GIMP2sharegimp2.0helpzh_CNfont-problems.html

    I.A....     11397  2009-10-01 08:10  GIMP2sharegimp2.0helpzh_CNgetting-started.html

    I.A....      9212  2009-10-01 08:11  GIMP2sharegimp2.0helpzh_CNgfdl-1.html

............此处省略5811个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)