From 0f0b251e7075de2b2a1972c9dff70839d338315b Mon Sep 17 00:00:00 2001 From: Garux Date: Sun, 3 May 2020 23:30:10 +0300 Subject: [PATCH] remove unnecessary gdk_pixbuf_add_alpha call --- libs/gtkutil/image.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/libs/gtkutil/image.cpp b/libs/gtkutil/image.cpp index b578b838..968797d7 100644 --- a/libs/gtkutil/image.cpp +++ b/libs/gtkutil/image.cpp @@ -40,19 +40,12 @@ void BitmapsPath_set( const char* path ){ GdkPixbuf* pixbuf_new_from_file_with_mask( const char* filename ){ GError *error = nullptr; - GdkPixbuf* rgb = gdk_pixbuf_new_from_file( filename, &error ); - if ( rgb == 0 ) { + GdkPixbuf* rgba = gdk_pixbuf_new_from_file( filename, &error ); + if ( rgba == 0 ) { globalErrorStream() << "ERROR: gdk_pixbuf_new_from_file(): " << error->message << "\n"; g_error_free( error ); - return 0; - } - else - { - //GdkPixbuf* rgba = gdk_pixbuf_add_alpha( rgb, TRUE, 255, 0, 255 ); //pink to alpha - GdkPixbuf* rgba = gdk_pixbuf_add_alpha( rgb, FALSE, 255, 0, 255 ); //alpha - g_object_unref( rgb ); - return rgba; } + return rgba; } GtkImage* image_new_from_file_with_mask( const char* filename ){