JPEG2000 works now
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@231 f711b948-2313-0410-aaa9-d29f33439f0b
This commit is contained in:
parent
6916b45f11
commit
6c5bdad151
|
@ -1,4 +1,17 @@
|
|||
import gtk,gtk.glade,gobject
|
||||
import os
|
||||
|
||||
class Converter:
|
||||
SUPPORTS = ["jp2"]
|
||||
|
||||
def convert(type, image_data):
|
||||
stdin, stdout = os.popen2("convert %s:- png:-" % type)
|
||||
stdin.write(image_data)
|
||||
stdin.close()
|
||||
return_data = stdout.read()
|
||||
stdout.close()
|
||||
return return_data
|
||||
convert = staticmethod(convert)
|
||||
|
||||
class PassportGUI:
|
||||
GLADE_FILE = "gui/passport/passport.glade"
|
||||
|
@ -83,6 +96,9 @@ class PassportGUI:
|
|||
def _set_images(self, data):
|
||||
self.images = []
|
||||
for type, image_data, description in data:
|
||||
if type in Converter.SUPPORTS:
|
||||
image_data = Converter.convert(type, image_data)
|
||||
|
||||
loader = gtk.gdk.PixbufLoader()
|
||||
loader.write(image_data)
|
||||
loader.close()
|
||||
|
|
|
@ -438,8 +438,6 @@ Machine Readable Zone data</property>
|
|||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image">
|
||||
<property name="width_request">240</property>
|
||||
<property name="height_request">320</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
<property name="icon_size">6</property>
|
||||
|
|
Loading…
Reference in New Issue