Re: Better PDF/PS/Dia thumbnailers



On 12 Apr 2003, Peter Harvey wrote:

> > > Where can I find a list of the arguments which can be passed to my
> > > scripts? Is %u %o and %s all there are? Also, what would be the
> > > recommended way to specify that thumbnails should be around the same
> > > size as my icons?
> > 
> > %u expands to the uri of the source file, %i expands to the filename of 
> > the source file (which means the script will be called on local files 
> > only), %o is the output filename, and %s is supposed to be the target 
> > thumbnail size.
> 
> Yep, %s works. But I would have thought that %i would expand to a
> filename. I get the following instead. If it really is supposed to be a
> file URL, not a filename, just tell me to shutup:
> 
> harvey samwise:~$ gconftool-2 -a /desktop/gnome/thumbnailers/application postscript
>  command = gnome-thumbnail-postscript %i %o %s
>  enable = true
> 
> harvey samwise:~$ touch algorithms.ps ; ps -u harvey -o pid,ppid,args |grep thumb
>  6880  6407 grep thumb
>  6881  6878 /bin/sh /usr/local/bin/gnome-thumbnail-postscript file:///home/harvey/algorithms.ps /tmp/.gnome_thumbnail.NwI8ws 128
>  6882  6881 /bin/sh /usr/local/bin/gnome-thumbnail-postscript file:///home/harvey/algorithms.ps /tmp/.gnome_thumbnail.NwI8ws 128


Very strange. The code sure looks right:
      switch (*p) {
      case 'u':
	quoted = g_shell_quote (inuri);
	g_string_append (str, quoted);
	g_free (quoted);
	got_in = TRUE;
	p++;
	break;
      case 'i':
	localfile = gnome_vfs_get_local_path_from_uri (inuri);
	if (localfile)
	  {
	    quoted = g_shell_quote (localfile);
	    g_string_append (str, quoted);
	    got_in = TRUE;
	    g_free (quoted);
	    g_free (localfile);
	  }
	p++;
	break;

> I also had a problem previously with 3 instances of "/bin/sh
> gnome-thumbnail-postscript" being run for every time I touched a file.
> Well, now it's down to 2 instances. Still don't know why. Again, I
> should probably look at the code myself when I have the time.

That would be cool. Btw, this code is in libgnomeui, not in nautilus.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a scarfaced voodoo inventor She's a foxy African-American Hell's Angel 
with someone else's memories. They fight crime! 




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