Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorerikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-11-02 23:36:14 (GMT)
committer erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-11-02 23:36:14 (GMT)
commitef13205ec76eb72598208433df4cc1b35b9d959a (patch)
tree80a572f4d2528fa460821161b23a15f0974405ce /utils.py
parentd9f68a9b9648629105269bcd93fc51314462dbec (diff)
fixes to gfx sizes
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@852 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py31
1 files changed, 12 insertions, 19 deletions
diff --git a/utils.py b/utils.py
index 7e6bc97..e116148 100644
--- a/utils.py
+++ b/utils.py
@@ -73,6 +73,17 @@ def generateThumbnail( pixbuf, scale, thumbw, thumbh ):
return thumbImg
+def scaleSvgToDim( handle, dim ):
+ #todo...
+ scale = 1.0
+
+ svgDim = handle.get_dimension_data()
+ if (svgDim[0] > dim[0]):
+ pass
+
+ return scale
+
+
def grayScalePixBuf( pb, copy ):
arr = pb.get_pixels_array()
if (copy):
@@ -83,22 +94,4 @@ def grayScalePixBuf( pb, copy ):
pxl[0][0] = y
pxl[1][0] = y
pxl[2][0] = y
- return gtk.gdk.pixbuf_new_from_array(arr, pb.get_colorspace(), pb.get_bits_per_sample())
-
-
-def convertSvgtoImg( name ):
- import instance
- import constants
-
- buttonPath = os.path.join(constants.Constants.gfxPath, name)
- buttonDataFile = open(buttonPath, 'r')
- buttonData = buttonDataFile.read()
- buttonSvg = loadSvg(buttonData, None, None)
- buttonDataFile.close()
- pb = buttonSvg.get_pixbuf()
- imgpath = os.path.join(instance.Instance.tmpPath, "ok.png")
- imgpath = getUniqueFilepath( imgpath, 0 )
- pb.save( imgpath, "png" )
- img = gtk.Image()
- img.set_from_pixbuf( pb )
- return img \ No newline at end of file
+ return gtk.gdk.pixbuf_new_from_array(arr, pb.get_colorspace(), pb.get_bits_per_sample()) \ No newline at end of file