gdkpixbuf

What image formats are supported by Gdk-Pixbuf (Gtk-Image?) by Default?

丶灬走出姿态 提交于 2019-11-28 09:12:56
问题 I know that Gdk-Pixbuf supports png and jpg, but I cannot find an exact list of all the completely (or partially) supported image formats anywhere on the internet. It is necessary for my current project, since I need to check the extension of every file in a directory and determine whether it is supported or not by gdk-pixbuf. Any help? 回答1: Calling gdk_pixbuf_get_formats() in your application will tell you which formats your copy of GDKPixbuf can load. 回答2: I know this is 5+ years old but I

Converting PIL GdkPixbuf

馋奶兔 提交于 2019-11-28 04:11:42
问题 How can I convert PIL Image in pixbuf?. I tried to change many examples but no solution import array from gi.repository import GdkPixbuf def image2pixbuf(self,im): arr = array.array('B', im.tostring()) height, width = im.size return GdkPixbuf.Pixbuf.new_from_data(arr, GdkPixbuf.Colorspace.RGB, True, 8, width, height, width * 4) Error TypeError: new_from_data () takes Exactly 9 arguments (7 given) I use Pygobject https://live.gnome.org/PyGObject 回答1: You are passing less arguments than