remove unnecessary gdk_pixbuf_add_alpha call

This commit is contained in:
Garux 2020-05-03 23:30:10 +03:00
parent c4528f8d64
commit 0f0b251e70

View File

@ -40,20 +40,13 @@ void BitmapsPath_set( const char* path ){
GdkPixbuf* pixbuf_new_from_file_with_mask( const char* filename ){ GdkPixbuf* pixbuf_new_from_file_with_mask( const char* filename ){
GError *error = nullptr; GError *error = nullptr;
GdkPixbuf* rgb = gdk_pixbuf_new_from_file( filename, &error ); GdkPixbuf* rgba = gdk_pixbuf_new_from_file( filename, &error );
if ( rgb == 0 ) { if ( rgba == 0 ) {
globalErrorStream() << "ERROR: gdk_pixbuf_new_from_file(): " << error->message << "\n"; globalErrorStream() << "ERROR: gdk_pixbuf_new_from_file(): " << error->message << "\n";
g_error_free( error ); 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 ){ GtkImage* image_new_from_file_with_mask( const char* filename ){
GdkPixbuf* rgba = pixbuf_new_from_file_with_mask( filename ); GdkPixbuf* rgba = pixbuf_new_from_file_with_mask( filename );