diff --git a/src/ImgManip.py b/src/ImgManip.py index 5f0612539..b9ac611a6 100644 --- a/src/ImgManip.py +++ b/src/ImgManip.py @@ -69,7 +69,7 @@ class ImgManip: return buf def fmt_scale_data(self,x,y,cnv): - cmd = "%s -geometry %dx%d '%s' '%s:-'" % (const.convert,x,y,cnv,self.src) + cmd = "%s -geometry %dx%d '%s' '%s:-'" % (const.convert,x,y,self.src,cnv) r,w = popen2.popen2(cmd) buf = r.read() r.close() diff --git a/src/docgen/RTFDoc.py b/src/docgen/RTFDoc.py index f109cca66..dc598c619 100644 --- a/src/docgen/RTFDoc.py +++ b/src/docgen/RTFDoc.py @@ -319,7 +319,6 @@ class RTFDoc(TextDoc): def add_photo(self,name,pos,x_cm,y_cm): im = ImgManip.ImgManip(name) nx,ny = im.size() - buf = im.jpg_data() ratio = float(x_cm)*float(ny)/(float(y_cm)*float(nx)) @@ -330,10 +329,10 @@ class RTFDoc(TextDoc): act_height = y_cm act_width = x_cm/ratio + buf = im.jpg_scale_data(int(act_width*40),int(act_height*40)) + act_width = twips(act_width) act_height = twips(act_height) - - im.thumbnail((int(act_width*40),int(act_height*40))) self.f.write('{\*\shppict{\\pict\\jpegblip') self.f.write('\\picwgoal%d\\pichgoal%d\n' % (act_width,act_height))