GNOME Bugzilla – Bug 145274
Progress bar needed for convert to INDEXED
Last modified: 2005-05-19 18:25:28 UTC
Converting from RGB to INDEXED can be very slow particularly if you are generating an optimised pallette. when you press the OK button it seems stuck and the Gimp pretty much locks up there is no progress indication. there first few times i did this i thought the GIMP had crashed because there was no feedback or indication of progress and so I killed it but if you wait long enough after a minute or two the image is actually successfully converted and the Gimp unfreezes. a progress bar needs to be added for this operation.
Well, it takes a couple of seconds for rather large images and Convert to Indexed is typically only used for GIF files which are a lot smaller. It wouldn't hurt to add a progress bar though.
> it takes a couple of seconds for rather my machine is a bit crap but there are probably people trying to run the Gimp on worse hardware (or even slower setups like from Knoppix). > Indexed is typically only used for GIF files and PNG of course I often want to get my files as small as possible and rarely use 24-bit PNG if i have a choice. In this case I was trying to make an INDEXED PSD file to save space but it automatically flattened on export (and I had to start again)
It's not a minute or two for me (more like 10 to 15 seconds for a 1024x768 px image), but it's at least a bit disturbing.
Created attachment 30197 [details] [review] A Patch to partially resolve the problem This patch partially resolves the problem. It has the limitation that it only works with RGB and with the FW dithering. (not with the rest). It also update the progress on every update from the internals, and thus may slow things down considerably. These things can be resolved in the future versions of the patch.
Created attachment 30206 [details] [review] A more-up-to-date patch This is a more modern patch. Changes since last time: 1. Changed the "baton" variable name component to "data". 2. Enabled progress for more configuration in the Something->Indexed conversion. 3. Fixed a bug that caused the RGB->Gray conversion to segfault. I thought about doing the same for the Gray->Indexed conversions, but it doesn't seem that this is needed, because the conversion is very fast.
I propose that this be committed, it looks good to me.
Fixed in CVS: 2004-08-09 Michael Natterer <mitch@gimp.org> Applied (slightly modified) patch from Shlomi Fish which adds a progress bar to the RGB -> INDEXED conversion. Fixes bug #145274 (and shows that we really really need a GimpProgressInterface in the core to give progress users full access to the progress API) * app/core/gimpimage-convert.[ch]: added special GimpImageConvertProgress function typedef to cope with the different stages of converting. Support passing such a callback & data to gimp_image_convert() and update the progress accordingly. * app/gui/convert-dialog.[ch]: added a convert progress callback and pass it to gimp_image_convert(). * app/actions/image-commands.c * tools/pdbgen/pdb/convert.pdb: changed accordingly. * app/pdb/convert_cmds.c: regenerated.
Verified against gimp 2.3