Re: Patch for 78542 - change thumbnails to use a thread

On 22 May 2002, Damon Chaplin wrote:

> I've updated the patch on the bug.

I applied the patch and read the resulting file, so some of this may
not be your code really:

get_file_mtime() will return INVALID_MTIME for files on nfs (they are
!is_local). This may not be what you expected, although in the common case 
we already have the mtime of the image.

The debug spew about the lock is at the wrong place, may be confusing:

	pthread_mutex_lock (&thumbnails_mutex);


	/* Check if it is already in the list of thumbnails to make. */
	if (g_list_find_custom ((GList*) thumbnails_to_make, info,
				compare_thumbnail_info) == NULL) {
		g_message ("(Main Thread) Locking mutex\n");

This code will probably give a warning if the timeout happened:

	/* Remove our timeout, if it still exists. */
	g_source_remove (timeout_id);

This code may render the svg at a really high resolution:
	if (eel_strcasecmp (info->mime_type, "image/svg") == 0) {
		char *image_path = gnome_vfs_get_local_path_from_uri (info->image_uri);
		if (image_path != NULL) {
			full_size_image = rsvg_pixbuf_from_file (image_path,
			g_free (image_path);

Better use:
        rsvg_pixbuf_from_file_at_size (image_path, 96, 96, NULL);

Otherwise it looks a lot better than the old code. Please commit.

 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a genetically engineered sweet-toothed farmboy from the 'hood. She's a 
radical junkie vampire who hides her beauty behind a pair of thick-framed 
spectacles. They fight crime! 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]