LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-31-2010, 02:13 AM   #1
drkdick
Member
 
Registered: Mar 2006
Distribution: Fedora, custom LFS, Ubuntu Studio (RT)
Posts: 37

Rep: Reputation: 15
Question Static thumbnail cache


When using file preview mode in konqueror within a folder with movies the system automatically generates snapshots with an app called "kffmpegthumbnailer" (10% into the movies). Say I'd like to create my own thumbnails for files that do not get a good representation automatically, where do I put these thumbnails?

Apparently Konqueror uses the folder "~/.thumbnails" as a cache storage. (if this is deleted, all thumbnail previews are regenerated). But when I try to supply my own thumbnail into this directory, it won't get used, instead a default one gets generated (even though the thumbnail type, size and name are identical).

How can I trick the cache functionality into using my own prepared samples instead of generating them. I would have thought there was a logical override, for example by supplying your own ".thumbnail" folder for files you'd like more control over, but this does not seem to be the case.

BTW, this is on a Fedora 12 system.
 
Old 08-31-2010, 10:08 AM   #2
drkdick
Member
 
Registered: Mar 2006
Distribution: Fedora, custom LFS, Ubuntu Studio (RT)
Posts: 37

Original Poster
Rep: Reputation: 15
After browsing the KDE source code ("previewjob.cpp") it seems as if the handler is relying on meta-information embedded in the png thumbnail files. I see there are references to at least file name, size and modification time in there. That would certainly explain why the preview handler is overriding my own attempts to override the default behaviour.

Does anybody know exactly what information needs to be included in a thumbnail file so that the preview handler will load it without failing? Is there a good application for editing png meta information?
 
Old 08-31-2010, 12:29 PM   #3
drkdick
Member
 
Registered: Mar 2006
Distribution: Fedora, custom LFS, Ubuntu Studio (RT)
Posts: 37

Original Poster
Rep: Reputation: 15
Ok, I think I'm getting a bit closer.

From the source code it seems as though the preview handler does the following checks to see if a cached thumbnail can be loaded:

- is there a .thumbnail folder
- is there a png-file in that folder with the correct name (an md5 hash of the path to the movie)
- does the png contain a chunk (metadata) containing the correct timestamp
- does the png contain a chunk with the full path to the movie

From experimenting with "ffmpegthumbnailer" I can create png's with these tags, but the entries do not appear exactly as when the KDE handler creates them. For example, KDE requires a full "file:///path/to/movie" string in the header. But when I try:

ffmpegthumbnailer -i file:///full/path/...

it complains about not being able to "stat" the file and thus leaves out the timestamp (which means that the KDE preview handler can't use it at all).
 
Old 08-31-2010, 03:00 PM   #4
drkdick
Member
 
Registered: Mar 2006
Distribution: Fedora, custom LFS, Ubuntu Studio (RT)
Posts: 37

Original Poster
Rep: Reputation: 15
So ... I downloaded and modified the "ffmpegthumbnailer" source code. Two minor (hackish-ugly) changes were enough to create png files capable of fooling the KDE handler, so it was indeed down to the metainformation embedded in the png file.

This whole episode have left me pondering about two things:

- why include a feature like movie thumbnailing if there isn't a way to customize it?
- why have such a strong and obscure binary format dependency?

Both of these seem un-linux like to me. Wouldn't it be much easier just to rely on the thumbnail hashed name and official timestamp for verification. An small hook in the KDE code scanning for a local .thumbnail directory before the system cache would also be my preferred way of doing it. Maybe I'm missing something in the big picture.

Still hoping someone will chip in with a solution involving "vanilla" tools.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Keeping your activities private on Linux - command history, shred, thumbnail cache chromei386 Linux - Security 6 12-11-2008 01:09 PM
openSUSE 10: Samba failed to create the cache directory in /var/cache mianmajidali Linux - Server 0 05-09-2008 02:00 AM
cache folder like /var/cache/apt/packages on Debian Shaddy SUSE / openSUSE 0 08-13-2006 10:02 AM
Ram wiht suse, cache Disk cache??? fadelhomsi Linux - Newbie 2 02-05-2006 11:29 PM
Error: Caching enabled and local cache: //var/cache/yum/base/primary.xml.gz does... dr_zayus69 Linux - Software 2 07-06-2005 04:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration