[haiku-development] Re: Image icons for images in Tracker

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 02 Mar 2012 10:45:02 +0100

Am 02.03.2012 09:49, schrieb Gabriel Harrison:
So I am starting to look through the code for Tracker and I see some
entry points using Pose, PoseView, Model and others that would allow me
to make Tracker display mini renders of images for the icons of images
rather than a uniform icon that doesn't help much. Even if there is no
interest in seeing this in the trunk or mainline, my question is:

After I build Tracker, how can I test it locally since I am building
from within Haiku?

There are multiple possibilities. The trick here is that the changed code is almost certainly in libtracker.so, not in Tracker.

One possibility is to use the app_server test environment. Another is to replace libtracker.so with a link to your own build and just restart Tracker with "hey Tracker quit" followed by "/system/Tracker". Replacing the system libtracker.so may lead to instabilities. Other programs use it as well, most importantly the DeskBar. There are mechanisms in the kernel which make sure that running programs don't have their linked libraries replaced, but these mechanisms don't handle all cases, IIRC.

When you use the app_server test environment, you get a completely separate Tracker process.

cd src/tests/servers/app
TARGET_PLATFORM=libbe_test jam install-test-apps
./run Tracker

I think Tracker is included in the test apps, but I am not completely sure. If it's not, it needs a modification in it's Jamfile, which would have to follow other examples you see in the test folder above.

However. All that said, I would strongly urge you not to change *anything* in Tracker (well, except see below). Instead, change BIconUtils in the Interface Kit. Make it return icons based on the image of the file. And please also special case using the JPEG translator, such that it returns the thumbnail from the EXIF data, which it is capable of. You have to read the translator's code to see how.

One problem of this approach is that Tracker uses an icon cache. You would have to implement some changes in Tracker's code, so that it knows when to invalidate a cached image icon and fetch it again from BIconUtils.

When you change BIconUtils, all apps get image thumbnails, not just Tracker or apps using libtracker.

Best regards,
-Stephan

Other related posts: