GNOME Bugzilla – Bug 623290
Save As... does not save Windows Bitmap as default in dialog
Last modified: 2010-07-07 18:29:05 UTC
When saving a file as a Windows BMP Image (bmp) using Save As..., the image is saved as a 16-bit color depth image when the default indicates it should be saved as a 32-bit A8R8G8B8 Click Save As... Select File_Type of Windows BMP Image (bmp) Click Save Click the + for Advanced Options. A8R8G8B8 is selected. Click Save. The image will be saved as a 16-bit color depth image. Another choice needs to be selected, then come back to A8R8G8B8 to get it to save in that format. Background: A PNG file was originally opened. The only changes were a Bucket Fill Tool and scaling the image from 512x512 to 32x32.
Created attachment 165174 [details] [review] Proposed fix I confirm this bug. For images with an alpha channel the gui shows an initial value different from what is actually used if the default is accepted. The problem is that in file 'plug-ins/file-bmp/bmp-write.c', line 915, 'gtk_toggle_button_set_active' is called before the button is connected to the corresponding callback. This was not a problem when the callback was connected to the "pressed" signal, but it is now that it is connected to the "clicked" signal (see bug #599233). The "clicked" signal for a radio_button is called for both the widgets toggled, and so, now, during gtk_toggle_button_set_active it is called only for the widget becoming inactive, resulting in the wrong value being set. The attached patch: 1) connects the callback before calling gtk_toggle_button_set_active 2) in 'format_callback', assign 'BMPSaveData.rgb_format' only if the button is active 3) connect each radio_button to the signal "toggled".
Thanks. Fixed in both branches: commit ca43054f084fa81f5b40f29739cdb9611d012ccb Author: Massimo Valentini <sixtysix@inwind.it> Date: Wed Jul 7 20:29:06 2010 +0200 Bug 623290 - Save As... does not save Windows Bitmap as default in dialog Connect to "toggled" signal of radio buttons.