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 145274 - Progress bar needed for convert to INDEXED
Progress bar needed for convert to INDEXED
Status: VERIFIED FIXED
Product: GIMP
Classification: Other
Component: User Interface
2.0.x
Other All
: Normal enhancement
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-07-01 22:00 UTC by Alan Horkan
Modified: 2005-05-19 18:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A Patch to partially resolve the problem (17.11 KB, patch)
2004-08-04 10:07 UTC, Shlomi Fish
none Details | Review
A more-up-to-date patch (19.51 KB, patch)
2004-08-04 15:47 UTC, Shlomi Fish
none Details | Review

Description Alan Horkan 2004-07-01 22:00:36 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.
Comment 1 Sven Neumann 2004-07-01 22:08:06 UTC
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.
Comment 2 Alan Horkan 2004-07-01 22:26:21 UTC
> 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)
Comment 3 Michael Schumacher 2004-07-05 12:50:31 UTC
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.
Comment 4 Shlomi Fish 2004-08-04 10:07:19 UTC
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.
Comment 5 Shlomi Fish 2004-08-04 15:47:16 UTC
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.
Comment 6 Dave Neary 2004-08-09 15:37:18 UTC
I propose that this be committed, it looks good to me.
Comment 7 Michael Natterer 2004-08-09 16:09:17 UTC
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.
Comment 8 Alan Horkan 2005-05-19 18:25:28 UTC
Verified against gimp 2.3