2007-09-12 Don Allingham <don@gramps-project.org>

* src/docgen/ODFDoc.py (ODFDoc): Fix ratio assignment



svn: r8965
This commit is contained in:
Don Allingham 2007-09-12 15:02:03 +00:00
parent 1cc238eea2
commit 04e249f902
3 changed files with 106 additions and 119 deletions

View File

@ -1,3 +1,6 @@
2007-09-12 Don Allingham <don@gramps-project.org>
* src/docgen/ODFDoc.py (ODFDoc): Fix ratio assignment
2007-09-12 Zsolt Foldvari <zfoldvar@users.sourceforge.net> 2007-09-12 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
* src/plugins/IndivComplete.py (write_person): * src/plugins/IndivComplete.py (write_person):
* src/plugins/IndivSummary.py (write_report): * src/plugins/IndivSummary.py (write_report):

View File

@ -443,6 +443,7 @@ class ODFDoc(BaseDoc.BaseDoc,BaseDoc.TextDoc,BaseDoc.DrawDoc):
if (x, y) == (0, 0): if (x, y) == (0, 0):
return return
ratio = float(x_cm)*float(y)/(float(y_cm)*float(x))
if ratio < 1: if ratio < 1:
act_width = x_cm act_width = x_cm
act_height = y_cm*ratio act_height = y_cm*ratio

View File

@ -120,23 +120,12 @@ class PackageWriter:
'Could not create %s' % uri_name) 'Could not create %s' % uri_name)
return return
try:
uri = URI('burn:///%s/.thumb' % base)
make_directory(uri,OPEN_WRITE)
except FileExistsError, msg:
QuestionDialog.ErrorDialog("CD export preparation failed",
"2 %s " % str(msg))
return
for obj_id in self.db.get_media_object_handles(): for obj_id in self.db.get_media_object_handles():
obj = self.db.get_object_from_handle(obj_id) obj = self.db.get_object_from_handle(obj_id)
oldfile = obj.get_path() oldfile = obj.get_path()
root = os.path.basename(oldfile) root = os.path.basename(oldfile)
if os.path.isfile(oldfile): if os.path.isfile(oldfile):
self.copy_file(oldfile, 'burn:///%s/%s' % (base, root)) self.copy_file(oldfile, 'burn:///%s/%s' % (base, root))
mime_type = obj.get_mime_type()
if mime_type and mime_type.startswith("image"):
self.make_thumbnail(base,root,obj.get_path())
else: else:
print "Warning: media file %s was not found, " % root, \ print "Warning: media file %s was not found, " % root, \
"so it was ignored." "so it was ignored."
@ -238,9 +227,6 @@ class PackageWriter:
sys.getfilesystemencoding()) sys.getfilesystemencoding())
if os.path.isfile(newfile): if os.path.isfile(newfile):
self.copy_file(newfile, 'burn:///%s/%s' % (base, obase)) self.copy_file(newfile, 'burn:///%s/%s' % (base, obase))
ntype = Mime.get_type(newfile)
if ntype and ntype.startswith("image"):
self.make_thumbnail(base,obase,newfile)
fs_top = gtk.FileSelection("%s - GRAMPS" % _("Select file")) fs_top = gtk.FileSelection("%s - GRAMPS" % _("Select file"))
fs_top.hide_fileop_buttons() fs_top.hide_fileop_buttons()
@ -260,9 +246,6 @@ class PackageWriter:
root = os.path.basename(oldfile) root = os.path.basename(oldfile)
if os.path.isfile(oldfile): if os.path.isfile(oldfile):
self.copy_file(oldfile, 'burn:///%s/%s' % (base, root)) self.copy_file(oldfile, 'burn:///%s/%s' % (base, root))
mime_type = obj.get_mime_type()
if mime_type and mime_type.startswith("image"):
self.make_thumbnail(base,root,obj.get_path())
else: else:
# File is lost => ask what to do # File is lost => ask what to do
self.object_handle = obj.get_handle() self.object_handle = obj.get_handle()