svn: r6190
This commit is contained in:
Alex Roitman 2006-03-21 19:11:32 +00:00
parent 96bf42149b
commit 360837b0b4

View File

@ -18,17 +18,40 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# $Id$
#-------------------------------------------------------------------------
#
# Standard python modules
#
#-------------------------------------------------------------------------
import os import os
import const
import signal import signal
import md5 import md5
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk import gtk
import gobject import gobject
#-------------------------------------------------------------------------
#
# gramps modules
#
#-------------------------------------------------------------------------
import const
import Mime import Mime
import Config import Config
import Utils import Utils
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
class ImgManip: class ImgManip:
def __init__(self,source): def __init__(self,source):
self.src = source self.src = source
@ -43,7 +66,8 @@ class ImgManip:
def fmt_thumbnail(self,dest,width,height,cnv): def fmt_thumbnail(self,dest,width,height,cnv):
w = int(width) w = int(width)
h = int(height) h = int(height)
cmd = "%s -geometry %dx%d '%s' '%s:%s'" % (const.convert,w,h,self.src,cnv,dest) cmd = "%s -geometry %dx%d '%s' '%s:%s'" % (const.convert,
w,h,self.src,cnv,dest)
os.system(cmd) os.system(cmd)
def fmt_convert(self,dest,cnv): def fmt_convert(self,dest,cnv):
@ -63,7 +87,8 @@ class ImgManip:
def fmt_scale_data(self,x,y,cnv): def fmt_scale_data(self,x,y,cnv):
import popen2 import popen2
cmd = "%s -geometry %dx%d '%s' '%s:-'" % (const.convert,x,y,self.src,cnv) cmd = "%s -geometry %dx%d '%s' '%s:-'" % (const.convert,
x,y,self.src,cnv)
signal.signal (signal.SIGCHLD, signal.SIG_DFL) signal.signal (signal.SIGCHLD, signal.SIG_DFL)
r,w = popen2.popen2(cmd) r,w = popen2.popen2(cmd)
buf = r.read() buf = r.read()