Part 1 of issue 4276. I principle same patch as for branch, but adapeted to trunk.

svn: r15959
This commit is contained in:
Peter Landgren
2010-10-09 12:33:47 +00:00
parent 5ba9d48f86
commit 1d8a776cd3
27 changed files with 118 additions and 45 deletions

View File

@@ -38,6 +38,13 @@ import tempfile
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
import Utils
#-------------------------------------------------------------------------
#
# resize_to_jpeg
@@ -111,6 +118,7 @@ def resize_to_jpeg_buffer(source, width, height):
img = gtk.gdk.pixbuf_new_from_file(source)
scaled = img.scale_simple(int(width), int(height), gtk.gdk.INTERP_BILINEAR)
os.close(filed)
dest = Utils.get_unicode_path_from_env_var(dest)
scaled.save(dest, 'jpeg')
ofile = open(dest, mode='rb')
data = ofile.read()