Sunday, March 10, 2013

Using the actual Thumbnail attribute in Tracker

While working on my earlier post about updating the Thumbnail application, I was reminded of a nagging irritation I've had not only since I started using Thumbnail, but especially since larger icon size options in tracker were added by John Scipione back in hrev44422.

In essence the problem is that currently Tracker uses either the BEOS:M:STD_ICON or BEOS:L:STD_ICON attributes to display the icon for the file in Tracker. But since these icons come from more than 15 years ago back in the BeOS days, those icon sizes are 16px and 32px respectively, on top of being dithered. (See the "GetIcon(), SetIcon(), GetTrackerIcon()" section of the BNodeInfo page in the BeBook for more info.)

While those may not look too terrible at those very small sizes (and even that is definitely arguable), the problem is that the 32px BEOS:L:STD_ICON is the biggest one we have to work with when it comes to showing a preview of the actual image for image files. So this gets scaled up double for even 64px sizes, triple for 96px, and quadruple for 128px sizes.

You can see the result of this for 96px sizes in the image below showing the current way it's done. And that's not even the worst example.

Now, what I noticed while tweaking the binaries for that earlier release was that there is also a GRAFX:Thumbnail attribute set, which includes a high quality (up to) 96px actual thumbnail version of the image. I kept finding myself wondering why the heck Tracker refused to use this far superior thumbnail even when I was using the largest icon size options.

I haven't gotten an answer to that question yet... as to whether or not it just hasn't been coded yet... or there is actually an ideological reason why not to do it, or even something architectural preventing it.

In the meantime, here are two images... the first of the way it is now... and the second showing how it could look if Tracker used the GRAFX:Thumbnail attribute instead.

Current Tracker settings
Mockup of using Thumbnail attribute

4 comments:

  1. That's very interesting! Would be very nice have high quality thumbnails in Tracker! I was looking for this since Haiku Alpha 1 :-)
    Maybe can you open an enhancement ticket?

    ReplyDelete
  2. Matt already had a ticket open on it, so I just updated his ticket with my info and pictures. :)

    https://dev.haiku-os.org/ticket/5700

    I'd really love to see this. And maybe even take it a step further and load scaled down versions of the thumbnail if available (load the icon initially for the smaller sizes (<=32px), then replace with a scaled down thumbnail)?

    The thumbnail attribute really just looks so much better than the icon ones. :/

    ReplyDelete
  3. The bitmap scaling I added to Tracker is meant for BeOS icons, and for that application it works pretty well producing a much nicer scaled image than bilinear scaling alone, yet, I have to agree that it looks terrible when applied to photographs.

    The real solution is that Tracker should create thumbnails behind your back, set them to the GRAFX:Thumbnail attribute and use those instead of trying to scale up a 32x32 version.

    Using the Thumbnailer app to set the GRAFX:Thumbnail attribute is a good solution in the meantime.

    ReplyDelete
  4. Yeah. dsjonny posted something to that effect on the ticket linked in my comment above:

    "One thing: if I know right, the GRAFX attribute will add by an application, so if the image has no this attribute, than only the standard icon will shown. Why not the Tracker generate this attribute when it is not present?
    There would be a "Show trumbnails" option in the Tracker. If we check this option, the Tracker will try to generate the thumbnail for image type entries, and show as an icon. If the image has already a thumbnail, then the Tracker will skip to generate it again. But if the image has been modified, then Tracker needs to regenerate the thumbnail."

    ReplyDelete