RSS/Atom feed Twitter
Site is read-only, email is disabled

[Fwd: Re: [maybe OT?] Code excerpts from the GIMP]

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

[Fwd: Re: [maybe OT?] Code excerpts from the GIMP] Tom Copeland 03 May 02:35
Tom Copeland
2005-05-03 02:35:12 UTC (over 19 years ago)

[Fwd: Re: [maybe OT?] Code excerpts from the GIMP]

-------- Forwarded Message --------

From: Sven Neumann
gimp-2.2.4/app/core/gimppreviewcache.c uses a GSList as a sort of size-based queue; it holds image previews in a GSList and uses g_slist_insert_sorted to insert the smaller images first. Oddly, another function in the same file trims the cache by iterating over the same GSList and comparing each item to find the smallest one to remove. Might be a possibility for some optimization there.

The function preview_cache_remove_smallest() which is used to trim the cache actually uses a different comparison than what is used to keep the list sorted. Whether this is what the author intended, I don't know.

Ah, you're right, it uses the area vs an x1 > x2 and y1 > y2 comparison. I've corrected that comment, thanks much!

http://infoether.com/~tom/gimp_snippets.html

It might be of interest to your readers to also include GimpList as an implementation of the GimpContainer class.

That is interesting. Backed by a GList, and sortable, and does unique names too, huh? Pretty cool.

Thanks,

Tom