mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
73d13c3f6a
commit
3de3f3d4fb
@ -18,6 +18,6 @@ def recipe_title_callback(raw):
|
||||
return eval(raw.decode('utf-8'))
|
||||
|
||||
vipy.session.add_content_browser('.r', ',r', 'Recipe',
|
||||
vipy.session.glob_based_iterator(os.path.join(project_dir, 'resources', 'recipes', '*.recipe')),
|
||||
vipy.session.glob_based_iterator(os.path.join(project_dir, 'recipes', '*.recipe')),
|
||||
vipy.session.regexp_based_matcher(r'title\s*=\s*(?P<title>.+)', 'title', recipe_title_callback))
|
||||
EOFPY
|
||||
|
@ -22,6 +22,7 @@ border_style_map = {
|
||||
'dot-dot-dash': 'dotted',
|
||||
'outset': 'outset',
|
||||
'tripple': 'double',
|
||||
'triple': 'double',
|
||||
'thick-thin-small': 'solid',
|
||||
'thin-thick-small': 'solid',
|
||||
'thin-thick-thin-small': 'solid',
|
||||
|
@ -251,12 +251,12 @@ class WMF(object):
|
||||
img.load(bmp)
|
||||
return img.export('png')
|
||||
|
||||
def wmf_unwrap(wmf_data):
|
||||
def wmf_unwrap(wmf_data, verbose=0):
|
||||
'''
|
||||
Return the largest embedded raster image in the WMF.
|
||||
The returned data is in PNG format.
|
||||
'''
|
||||
w = WMF()
|
||||
w = WMF(verbose=verbose)
|
||||
w(wmf_data)
|
||||
if not w.has_raster_image:
|
||||
raise ValueError('No raster image found in the WMF')
|
||||
@ -266,4 +266,5 @@ if __name__ == '__main__':
|
||||
wmf = WMF(verbose=4)
|
||||
wmf(open(sys.argv[-1], 'rb'))
|
||||
open('/t/test.bmp', 'wb').write(wmf.bitmaps[0])
|
||||
open('/t/test.png', 'wb').write(wmf.to_png())
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user