~schnouki/smartbg

6551cbfbefa5fbe40ef44b9901f655e5bcce54aa — Thomas Jost 8 years ago 9f25572
Always use an alpha channel

Without this, some PNGs don't render properly.
1 files changed, 3 insertions(+), 3 deletions(-)

M smartbg
M smartbg => smartbg +3 -3
@@ 31,7 31,7 @@ def get_image_path(args):
            for ext in IMG_EXTENSIONS:
                paths.extend(glob.iglob(os.path.join(path, "*.%s" % ext)))
        elif os.path.isfile(path):
            paths.append(path)        
            paths.append(path)
        else:
            raise Exception("%s is not a file nor a directory" % path)



@@ 54,7 54,7 @@ def add_image_to_pixbuf(pb, geom, img):
    # Scaling needed?
    if iw > gw or ih > gh or (iw < gw and ih < gh):
        ratio = float(iw)/float(ih)
        

        # Try width first
        if gw / ratio <= gh:
            print " * scaling (based on height)"


@@ 146,7 146,7 @@ win = gtk.gdk.get_default_root_window()
sw, sh = scr.get_width(), scr.get_height()

# Pixbuf for rendering the pictures
wp = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, sw, sh)
wp = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, sw, sh)
wp.fill(0x000000ff)

# Prepare an image for each monitor