Abstracted out the use of Imagick vs. PIL
svn: r741
This commit is contained in:
parent
b54a2f8527
commit
d6f1a8b1c5
@ -249,7 +249,11 @@ class Gallery(ImageSelect):
|
|||||||
def add_thumbnail(self, photo):
|
def add_thumbnail(self, photo):
|
||||||
object = photo.getReference()
|
object = photo.getReference()
|
||||||
name = utils.thumb_path(self.db.getSavePath(),object)
|
name = utils.thumb_path(self.db.getSavePath(),object)
|
||||||
thumb = GdkImlib.Image(name)
|
try:
|
||||||
|
thumb = GdkImlib.Image(name)
|
||||||
|
except IOError,msg:
|
||||||
|
gnome.ui.GnomeErrorDialog(_("Could not import %s - %s") % (name,msg))
|
||||||
|
return
|
||||||
self.icon_cache.append(thumb)
|
self.icon_cache.append(thumb)
|
||||||
description = object.getDescription()
|
description = object.getDescription()
|
||||||
if len(description) > 50:
|
if len(description) > 50:
|
||||||
|
106
gramps/src/ImgManip.py
Normal file
106
gramps/src/ImgManip.py
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
#
|
||||||
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
|
#
|
||||||
|
# Copyright (C) 2000 Donald N. Allingham
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
|
||||||
|
import os
|
||||||
|
import const
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Check for the python imaging library
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
try:
|
||||||
|
import PIL.Image
|
||||||
|
no_pil = 0
|
||||||
|
except:
|
||||||
|
import popen2
|
||||||
|
import GDK
|
||||||
|
import GTK
|
||||||
|
import gtk
|
||||||
|
import GdkImlib
|
||||||
|
no_pil = 1
|
||||||
|
|
||||||
|
class ImgManip:
|
||||||
|
def __init__(self,source):
|
||||||
|
self.source = source
|
||||||
|
|
||||||
|
def jpg_thumbnail(self,dest,width,height):
|
||||||
|
if no_pil:
|
||||||
|
w = int(width)
|
||||||
|
h = int(height)
|
||||||
|
cmd = "%s -geometry %dx%d '%s' 'jpg:%s'" % (const.convert,w,h,self.source,dest)
|
||||||
|
os.system(cmd)
|
||||||
|
else:
|
||||||
|
im = PIL.Image.open(self.source)
|
||||||
|
im.thumbnail((width,height))
|
||||||
|
if im.mode != 'RGB':
|
||||||
|
im.draft('RGB',im.size)
|
||||||
|
im = im.convert("RGB")
|
||||||
|
im.save(dest,"JPEG")
|
||||||
|
|
||||||
|
def png_thumbnail(self,dest,width,height):
|
||||||
|
if no_pil:
|
||||||
|
w = int(width)
|
||||||
|
h = int(height)
|
||||||
|
cmd = "%s -geometry %dx%d '%s' 'png:%s'" % (const.convert,w,h,self.source,dest)
|
||||||
|
os.system(cmd)
|
||||||
|
else:
|
||||||
|
im = PIL.Image.open(self.source)
|
||||||
|
im.thumbnail((width,height))
|
||||||
|
if im.mode != 'RGB':
|
||||||
|
im.draft('RGB',im.size)
|
||||||
|
im = im.convert("RGB")
|
||||||
|
im.save(dest,"PNG")
|
||||||
|
|
||||||
|
def size(self):
|
||||||
|
if no_pil:
|
||||||
|
img = GdkImlib.Image(self.source)
|
||||||
|
return (img.rgb_width,img.rgb_height)
|
||||||
|
else:
|
||||||
|
return PIL.Image.open(self.source).size
|
||||||
|
|
||||||
|
def jpg_data(self):
|
||||||
|
if no_pil:
|
||||||
|
cmd = "%s '%s' 'jpg:-'" % (const.convert,self.source)
|
||||||
|
r,w = popen2.popen2(cmd)
|
||||||
|
buf = r.read()
|
||||||
|
r.close()
|
||||||
|
w.close()
|
||||||
|
return buf
|
||||||
|
else:
|
||||||
|
im = PIL.Image.open(self.source)
|
||||||
|
return im.tostring("jpeg","RGB")
|
||||||
|
|
||||||
|
def png_scale_data(self,x,y):
|
||||||
|
if no_pil:
|
||||||
|
cmd = "%s -geometry %dx%d'%s' 'jpg:-'" % (const.convert,x,y,self.source)
|
||||||
|
r,w = popen2.popen2(cmd)
|
||||||
|
buf = r.read()
|
||||||
|
r.close()
|
||||||
|
w.close()
|
||||||
|
return buf
|
||||||
|
else:
|
||||||
|
im = PIL.Image.open(self.source)
|
||||||
|
im.thumbnail((width,height))
|
||||||
|
if im.mode != 'RGB':
|
||||||
|
im.draft('RGB',im.size)
|
||||||
|
im = im.convert("RGB")
|
||||||
|
return im.tostring("png","RGB")
|
||||||
|
|
@ -41,19 +41,10 @@ from gnome.ui import GnomeErrorDialog, GnomeWarningDialog
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import const
|
import const
|
||||||
import utils
|
import utils
|
||||||
|
import ImgManip
|
||||||
from intl import gettext
|
from intl import gettext
|
||||||
_ = gettext
|
_ = gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Check for the python imaging library
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
try:
|
|
||||||
import PIL.Image
|
|
||||||
no_pil = 0
|
|
||||||
except:
|
|
||||||
no_pil = 1
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -88,7 +79,7 @@ def import_media_object(filename,path,base):
|
|||||||
path = "%s/%s" % (thumb,base)
|
path = "%s/%s" % (thumb,base)
|
||||||
mk_thumb(filename,path,const.thumbScale)
|
mk_thumb(filename,path,const.thumbScale)
|
||||||
except:
|
except:
|
||||||
GnomeErrorDialog(_("Error creating the thumbnail : %s") + "\n" + msg)
|
GnomeErrorDialog(_("Error creating the thumbnail : %s"))
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -159,20 +150,12 @@ def mk_thumb(source,dest,size):
|
|||||||
if not os.path.exists(source):
|
if not os.path.exists(source):
|
||||||
GnomeErrorDialog(_("Could not create a thumbnail for %s\nThe file has been moved or deleted") % source)
|
GnomeErrorDialog(_("Could not create a thumbnail for %s\nThe file has been moved or deleted") % source)
|
||||||
|
|
||||||
if no_pil:
|
try:
|
||||||
cmd = "%s -geometry %dx%d '%s' '%s'" % (const.convert,size,size,source,dest)
|
img = ImgManip.ImgManip(source)
|
||||||
os.system(cmd)
|
img.jpg_thumbnail(dest,size,size)
|
||||||
else:
|
except:
|
||||||
try:
|
GnomeErrorDialog(_("Could not create a thumbnail for %s") % source)
|
||||||
im = PIL.Image.open(source)
|
return
|
||||||
im.thumbnail((size,size))
|
|
||||||
if im.mode != 'RGB':
|
|
||||||
im.draft('RGB',im.size)
|
|
||||||
im = im.convert("RGB")
|
|
||||||
im.save(dest,"JPEG")
|
|
||||||
except:
|
|
||||||
GnomeErrorDialog(_("Could not create a thumbnail for %s") % source)
|
|
||||||
return
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -26,7 +26,8 @@ import utils
|
|||||||
def need_to_run():
|
def need_to_run():
|
||||||
if gnome.config.get_string("/gramps/config/startup") == None:
|
if gnome.config.get_string("/gramps/config/startup") == None:
|
||||||
return 1
|
return 1
|
||||||
if gnome.config.get_int("/gramps/config/startup") < const.startup:
|
val = gnome.config.get_int("/gramps/config/startup")
|
||||||
|
if val < const.startup:
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -34,20 +34,10 @@ from latin_utf8 import latin_to_utf8
|
|||||||
import const
|
import const
|
||||||
import string
|
import string
|
||||||
import Plugins
|
import Plugins
|
||||||
|
import ImgManip
|
||||||
import intl
|
import intl
|
||||||
_ = intl.gettext
|
_ = intl.gettext
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Attemp to import the Python Imaging Library
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
try:
|
|
||||||
import PIL.Image
|
|
||||||
no_pil = 0
|
|
||||||
except:
|
|
||||||
no_pil = 1
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Class Definitions
|
# Class Definitions
|
||||||
@ -102,23 +92,16 @@ class AbiWordDoc(TextDoc):
|
|||||||
file = file_tuple[0]
|
file = file_tuple[0]
|
||||||
width = file_tuple[1]
|
width = file_tuple[1]
|
||||||
height = file_tuple[2]
|
height = file_tuple[2]
|
||||||
base = "/tmp/%s.png" % os.path.basename(file)
|
base = "%s/%s_png" % (os.path.dirname(file),os.path.basename(file))
|
||||||
tag = string.replace(base,'.','_')
|
tag = string.replace(base,'.','_')
|
||||||
|
|
||||||
if no_pil:
|
img = ImgManip.ImgManip(file)
|
||||||
cmd = "%s -geometry %dx%d '%s' '%s'" % (const.convert,width,height,file,base)
|
buf = img.png_scale_data(width,height)
|
||||||
os.system(cmd)
|
|
||||||
else:
|
|
||||||
im = PIL.Image.open(file)
|
|
||||||
im.thumbnail((width,height))
|
|
||||||
im.save(base,"PNG")
|
|
||||||
|
|
||||||
self.f.write('<d name="')
|
self.f.write('<d name="')
|
||||||
self.f.write(tag)
|
self.f.write(tag)
|
||||||
self.f.write('" mime-type="image/png" base64="yes">\n')
|
self.f.write('" mime-type="image/png" base64="yes">\n')
|
||||||
f = open(base,"rb")
|
self.f.write(base64.encodestring(buf))
|
||||||
base64.encode(f,self.f)
|
|
||||||
f.close()
|
|
||||||
os.unlink(base)
|
os.unlink(base)
|
||||||
self.f.write('</d>\n')
|
self.f.write('</d>\n')
|
||||||
self.f.write('</data>\n')
|
self.f.write('</data>\n')
|
||||||
@ -238,5 +221,4 @@ class AbiWordDoc(TextDoc):
|
|||||||
self.f.write('; text-decoration:underline')
|
self.f.write('; text-decoration:underline')
|
||||||
self.f.write('">')
|
self.f.write('">')
|
||||||
|
|
||||||
|
|
||||||
Plugins.register_text_doc(_("AbiWord"),AbiWordDoc,0,1,1)
|
Plugins.register_text_doc(_("AbiWord"),AbiWordDoc,0,1,1)
|
||||||
|
@ -24,22 +24,12 @@ import re
|
|||||||
import utils
|
import utils
|
||||||
import gnome.ui
|
import gnome.ui
|
||||||
import Plugins
|
import Plugins
|
||||||
|
import ImgManip
|
||||||
|
from TextDoc import *
|
||||||
|
|
||||||
from intl import gettext
|
from intl import gettext
|
||||||
_ = gettext
|
_ = gettext
|
||||||
|
|
||||||
from TextDoc import *
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Attempt to load the Python Imaging Library for the handling of photos.
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
try:
|
|
||||||
import PIL.Image
|
|
||||||
no_pil = 0
|
|
||||||
except:
|
|
||||||
no_pil = 1
|
|
||||||
|
|
||||||
t_header_line_re = re.compile(r"(.*)<TITLE>(.*)</TITLE>(.*)", re.DOTALL|re.IGNORECASE|re.MULTILINE)
|
t_header_line_re = re.compile(r"(.*)<TITLE>(.*)</TITLE>(.*)", re.DOTALL|re.IGNORECASE|re.MULTILINE)
|
||||||
|
|
||||||
@ -238,41 +228,22 @@ class HtmlDoc(TextDoc):
|
|||||||
self.f.close()
|
self.f.close()
|
||||||
|
|
||||||
def add_photo(self,name,pos,x,y):
|
def add_photo(self,name,pos,x,y):
|
||||||
if no_pil:
|
|
||||||
return
|
|
||||||
|
|
||||||
self.empty = 0
|
self.empty = 0
|
||||||
try:
|
|
||||||
im = PIL.Image.open(name)
|
|
||||||
except:
|
|
||||||
return
|
|
||||||
|
|
||||||
nx,ny = im.size
|
|
||||||
|
|
||||||
scale = float(nx)/float(ny)
|
size = int(max(x,y) * float(150.0/2.54))
|
||||||
if scale > 1.0:
|
|
||||||
scale = 1.0/scale
|
|
||||||
act_width = float(x)
|
|
||||||
act_height = float(y * scale)
|
|
||||||
else:
|
|
||||||
act_width = float(x * scale)
|
|
||||||
act_height = float(y)
|
|
||||||
|
|
||||||
cmtopt = float(150.0/2.54)
|
|
||||||
pixx = int(act_width*cmtopt)
|
|
||||||
pixy = int(act_height*cmtopt)
|
|
||||||
im.thumbnail((pixx,pixy))
|
|
||||||
|
|
||||||
|
refname = "is%s" % os.path.basename(name)
|
||||||
imdir = self.base + os.sep + "images"
|
imdir = self.base + os.sep + "images"
|
||||||
|
|
||||||
if not os.path.isdir(imdir):
|
if not os.path.isdir(imdir):
|
||||||
try:
|
try:
|
||||||
os.mkdir(imdir)
|
os.mkdir(imdir)
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
|
||||||
refname = "is%s" % os.path.basename(name)
|
|
||||||
try:
|
try:
|
||||||
im.save(imdir + os.sep + refname)
|
img = ImgManip.ImgManip(name)
|
||||||
|
img.jpg_thumbnail(imdir + os.sep + refname,size,size)
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -283,8 +254,8 @@ class HtmlDoc(TextDoc):
|
|||||||
else:
|
else:
|
||||||
xtra = ''
|
xtra = ''
|
||||||
|
|
||||||
self.f.write('<img src="images/%s" border="0" width="%d" height="%d"%s>\n' % \
|
self.f.write('<img src="images/%s" border="0""%s>\n' % \
|
||||||
(refname,pixx,pixy,xtra))
|
(refname,xtra))
|
||||||
|
|
||||||
def start_table(self,name,style):
|
def start_table(self,name,style):
|
||||||
self.tbl = self.table_styles[style]
|
self.tbl = self.table_styles[style]
|
||||||
|
@ -27,15 +27,10 @@ import os
|
|||||||
import gzip
|
import gzip
|
||||||
from TarFile import TarFile
|
from TarFile import TarFile
|
||||||
import Plugins
|
import Plugins
|
||||||
|
import ImgManip
|
||||||
import intl
|
import intl
|
||||||
_ = intl.gettext
|
_ = intl.gettext
|
||||||
|
|
||||||
try:
|
|
||||||
import PIL.Image
|
|
||||||
no_pil = 0
|
|
||||||
except:
|
|
||||||
no_pil = 1
|
|
||||||
|
|
||||||
def points(val):
|
def points(val):
|
||||||
inch = float(val)/2.54
|
inch = float(val)/2.54
|
||||||
return (int(inch*72))
|
return (int(inch*72))
|
||||||
@ -356,11 +351,9 @@ class KwordDoc(TextDoc):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def add_photo(self,name,pos,x,y):
|
def add_photo(self,name,pos,x,y):
|
||||||
if no_pil:
|
|
||||||
return
|
|
||||||
|
|
||||||
im = PIL.Image.open(name)
|
im = ImgManip.ImgMapip(name)
|
||||||
nx,ny = im.size
|
nx,ny = im.size()
|
||||||
|
|
||||||
scale = float(nx)/float(ny)
|
scale = float(nx)/float(ny)
|
||||||
x = points(x)
|
x = points(x)
|
||||||
|
@ -28,13 +28,9 @@ import const
|
|||||||
import utils
|
import utils
|
||||||
import Plugins
|
import Plugins
|
||||||
import intl
|
import intl
|
||||||
_ = intl.gettext
|
import ImgManip
|
||||||
|
|
||||||
try:
|
_ = intl.gettext
|
||||||
import PIL.Image
|
|
||||||
no_pil = 0
|
|
||||||
except:
|
|
||||||
no_pil = 1
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from codecs import *
|
from codecs import *
|
||||||
@ -502,13 +498,12 @@ class OpenOfficeDoc(TextDoc):
|
|||||||
height = file_tuple[2]
|
height = file_tuple[2]
|
||||||
base = os.path.basename(file)
|
base = os.path.basename(file)
|
||||||
image_name = self.tempdir + os.sep + "Pictures" + os.sep + base
|
image_name = self.tempdir + os.sep + "Pictures" + os.sep + base
|
||||||
if no_pil:
|
|
||||||
cmd = "%s -geometry %dx%d '%s' '%s'" % (const.convert,width,height,file,image_name)
|
try:
|
||||||
os.system(cmd)
|
img = ImgManip.ImgManip(file)
|
||||||
else:
|
img.jpg_thumbnail(image_name)
|
||||||
im = PIL.Image.open(file)
|
except:
|
||||||
im.thumbnail((width,height))
|
pass
|
||||||
im.save(image_name,"JPEG")
|
|
||||||
|
|
||||||
def _write_manifest(self):
|
def _write_manifest(self):
|
||||||
file = self.tempdir + os.sep + "META-INF" + os.sep + "manifest.xml"
|
file = self.tempdir + os.sep + "META-INF" + os.sep + "manifest.xml"
|
||||||
|
@ -40,17 +40,6 @@ from reportlab.lib.colors import Color
|
|||||||
from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY
|
from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY
|
||||||
import reportlab.lib.styles
|
import reportlab.lib.styles
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Attempt to load the python imaging library
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
try:
|
|
||||||
import PIL.Image
|
|
||||||
no_pil = 0
|
|
||||||
except:
|
|
||||||
no_pil = 1
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GrampsDocTemplate
|
# GrampsDocTemplate
|
||||||
@ -267,22 +256,20 @@ class PdfDoc(TextDoc):
|
|||||||
self.col = self.col + self.span
|
self.col = self.col + self.span
|
||||||
|
|
||||||
def add_photo(self,name,pos,x,y):
|
def add_photo(self,name,pos,x,y):
|
||||||
if no_pil == 0:
|
img = ImgManip.ImgManip(name)
|
||||||
im = PIL.Image.open(name)
|
nx,ny = img.size()
|
||||||
|
scale = float(nx)/float(ny)
|
||||||
|
if scale > 1.0:
|
||||||
|
scale = 1.0/scale
|
||||||
|
act_width = x
|
||||||
|
act_height = y * scale
|
||||||
|
else:
|
||||||
|
act_width = x * scale
|
||||||
|
act_height = y
|
||||||
|
|
||||||
nx,ny = im.size
|
self.story.append(Image(name,act_width*cm,act_height*cm))
|
||||||
scale = float(nx)/float(ny)
|
self.story.append(Spacer(1,0.5*cm))
|
||||||
if scale > 1.0:
|
self.image = 1
|
||||||
scale = 1.0/scale
|
|
||||||
act_width = x
|
|
||||||
act_height = y * scale
|
|
||||||
else:
|
|
||||||
act_width = x * scale
|
|
||||||
act_height = y
|
|
||||||
|
|
||||||
self.story.append(Image(name,act_width*cm,act_height*cm))
|
|
||||||
self.story.append(Spacer(1,0.5*cm))
|
|
||||||
self.image = 1
|
|
||||||
|
|
||||||
def write_text(self,text):
|
def write_text(self,text):
|
||||||
self.text = self.text + text
|
self.text = self.text + text
|
||||||
|
@ -25,20 +25,11 @@
|
|||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from TextDoc import *
|
from TextDoc import *
|
||||||
import Plugins
|
import Plugins
|
||||||
|
import ImgManip
|
||||||
|
|
||||||
import intl
|
import intl
|
||||||
_ = intl.gettext
|
_ = intl.gettext
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# Attempt to load the Python Imaging Library for the handling of photos.
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------
|
|
||||||
try:
|
|
||||||
import PIL.Image
|
|
||||||
no_pil = 0
|
|
||||||
except:
|
|
||||||
no_pil = 1
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# RTF uses a unit called "twips" for its measurements. According to the
|
# RTF uses a unit called "twips" for its measurements. According to the
|
||||||
@ -324,17 +315,14 @@ class RTFDoc(TextDoc):
|
|||||||
# to JPEG, since it is smaller, and supported by RTF. The data is
|
# to JPEG, since it is smaller, and supported by RTF. The data is
|
||||||
# dumped as a string of HEX numbers.
|
# dumped as a string of HEX numbers.
|
||||||
#
|
#
|
||||||
# If the PIL library is not loaded, ignore the request to load the
|
|
||||||
# photo.
|
|
||||||
#
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
def add_photo(self,name,pos,x_cm,y_cm):
|
def add_photo(self,name,pos,x_cm,y_cm):
|
||||||
if no_pil:
|
if no_pil:
|
||||||
return
|
return
|
||||||
|
|
||||||
im = PIL.Image.open(name)
|
im = ImgManip.ImgManip(name)
|
||||||
nx,ny = im.size
|
nx,ny = im.size()
|
||||||
buf = im.tostring("jpeg","RGB")
|
buf = im.jpg_data()
|
||||||
|
|
||||||
scale = float(ny)/float(nx)
|
scale = float(ny)/float(nx)
|
||||||
if scale > 1:
|
if scale > 1:
|
||||||
|
@ -17,7 +17,7 @@ install:
|
|||||||
${INSTALL} *.py *.pyo ${datadir}/filters
|
${INSTALL} *.py *.pyo ${datadir}/filters
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm ${filters}/*.py ${filters}/*.pyo ${filters}/*.glade ${filters}/*.xpm
|
rm ${filters}/*.py ${filters}/*.pyo
|
||||||
-rmdir ${filters}
|
-rmdir ${filters}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
Binary file not shown.
@ -12,13 +12,12 @@ pycomp = ${srcdir}/py-compile
|
|||||||
all:
|
all:
|
||||||
${pycomp} *.py
|
${pycomp} *.py
|
||||||
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
${INSTALL} -d ${plugins}
|
${INSTALL} -d ${plugins}
|
||||||
${INSTALL} *.py *.pyo *.glade ${plugins}
|
${INSTALL} *.py *.pyo *.glade ${plugins}
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm ${plugins}/*.py ${plugins}/*.pyo ${plugins}/*.glade ${plugins}/*.xpm
|
rm ${plugins}/*.py ${plugins}/*.pyo ${plugins}/*.glade
|
||||||
-rmdir ${plugins}
|
-rmdir ${plugins}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -671,7 +671,7 @@ class WebReport(Report):
|
|||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
def dump_index(self,person_list,styles,template,html_dir):
|
def dump_index(self,person_list,styles,template,html_dir):
|
||||||
|
|
||||||
doc = HtmlLinkDoc(styles,template)
|
doc = HtmlLinkDoc(self.selected_style,None,template,None)
|
||||||
doc.set_title(_("Family Tree Index"))
|
doc.set_title(_("Family Tree Index"))
|
||||||
|
|
||||||
doc.open(html_dir + os.sep + "index.html")
|
doc.open(html_dir + os.sep + "index.html")
|
||||||
@ -728,7 +728,7 @@ class WebReport(Report):
|
|||||||
filter(self.db,self.person,ind_list,self.max_gen)
|
filter(self.db,self.person,ind_list,self.max_gen)
|
||||||
self.progress_bar_setup(float(len(ind_list)))
|
self.progress_bar_setup(float(len(ind_list)))
|
||||||
|
|
||||||
doc = HtmlLinkDoc(self.selected_style,self.template_name)
|
doc = HtmlLinkDoc(self.selected_style,None,self.template_name,None)
|
||||||
self.add_styles(doc)
|
self.add_styles(doc)
|
||||||
doc.build_style_declaration()
|
doc.build_style_declaration()
|
||||||
|
|
||||||
@ -736,7 +736,7 @@ class WebReport(Report):
|
|||||||
for l in ind_list:
|
for l in ind_list:
|
||||||
my_map[l] = 1
|
my_map[l] = 1
|
||||||
for person in ind_list:
|
for person in ind_list:
|
||||||
tdoc = HtmlLinkDoc(self.selected_style,None,doc)
|
tdoc = HtmlLinkDoc(self.selected_style,None,None,None,doc)
|
||||||
idoc = IndividualPage(person, self.photos, self.restrict,
|
idoc = IndividualPage(person, self.photos, self.restrict,
|
||||||
self.private, self.srccomments,
|
self.private, self.srccomments,
|
||||||
self.include_link, my_map, dir_name, tdoc)
|
self.include_link, my_map, dir_name, tdoc)
|
||||||
|
3102
gramps/src/po/fr.po
3102
gramps/src/po/fr.po
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user