After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705889 - BMP plug-in - no support for 'do not write color space information' in script-fu
BMP plug-in - no support for 'do not write color space information' in script-fu
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: Plugins
2.8.4
Other All
: Normal enhancement
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2013-08-13 10:40 UTC by EAB
Modified: 2018-05-24 13:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds script-fu save command to let users not write color space info (also adds the other two BMP save options) (9.88 KB, patch)
2017-06-23 15:44 UTC, Nikc M.
none Details | Review

Description EAB 2013-08-13 10:40:10 UTC
Can't find an equivalent for 'do not write color space information' in script-fu?

'file-bmp-save' does not seem to have this option, but googling around a little it seems that this is a very much needed option for others as well because my script now creates bmp's not compatible with some programs...
Comment 1 Michael Schumacher 2013-08-18 17:48:21 UTC
Shouldn't be that hard to add this to the BMP plug-in. Do you want to give it a try? 

But note that the current procedure must stay as it is for compatibility, you'll have to introduce a new one. See e.g. the PNG plug-in, which registers file-png-save2 to add new parameters because of the same requirement.
Comment 2 Kevin Cozens 2014-02-03 23:02:27 UTC
Adding a new callable procedure in the BMP plug-in is the best way to fix this. Changing Component to Plug-ins.
Comment 3 Nikc M. 2017-06-23 15:44:32 UTC
Created attachment 354320 [details] [review]
Adds script-fu save command to let users not write color space info (also adds the other two BMP save options)

This patch adds a new script-fu procedure, file-bmp-save2, which allows non-interactive control of whether the color space is written or not. It also adds the other two BMP save options, whether to use Run-Length Encoding and what RGB Format to save the pixels in.

Edits the following files in plug-ins/file-bmp/:
bmp.h
bmp.c
bmp-save.h
bmp-save.c

Two notes:
1) BMPs only have Run-Length encoding for 4bpp or 8bpp images (RLE4 & RLE8). If you set the 'use-rle' flag in file-bmp-save2 on any other type of BMP, GIMP's current write_image() function ignores it and produces a valid (but uncompressed) image. I'm unsure if that's acceptable behavior, or if the script-fu should throw a warning or an error.

2) The 'rgb-format' value is an enum type called "RGBMode". Since I couldn't use that as a datatype for the script-fu, I ask for an integer in the command. That's then used as an index to cast the appropriate value from the RGBMode enum.
	This works because the enum has no defined values, so you can access them in default order [(RGBMode) 0 casts to 'RGB_565', (RGBMode) 1 casts to 'RGBA_5551', etc]. If the RGBMode enum was ever initialized to have values (E.g. RGBA_5551 = 10;), the casting would break and would have to be re-written at that time.

I'm not sure if those two notes are issues or not - if they are, I'm happy to update the patch as needed.
Comment 4 GNOME Infrastructure Team 2018-05-24 13:49:36 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/491.