Opened 14 years ago

Closed 3 years ago

#5700 closed enhancement (fixed)

Ability to show thumbnails of images

Reported by: mmadia Owned by: jscipione
Priority: normal Milestone: Unscheduled
Component: Applications/Tracker Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #15107
Platform: All

Description

Being able to display a thumbnail of images would be beneficial, if not an expected feature.

The later Tracker.NewFS builds included this functionality. The thumbnails were stored in BFS attributes.

Attachments (2)

tracker-thumbnails1-default.png (76.7 KB ) - added by jstressman 11 years ago.
Tracker as it is now, using the upscaled 8bit dithered 32px icons
tracker-thumbnails1-thumbnail.png (242.1 KB ) - added by jstressman 11 years ago.
Tracker mockup using the full color 96px thumbnails from the GRAFX:Thumbnail attribute.

Download all attachments as: .zip

Change History (27)

comment:1 by jstressman, 11 years ago

I actually just wrote a blog article about this earlier today and made a mockup to show how much better it would look.

To paraphrase that article a bit:

The lack of using the actual thumbnail attribute has become especially apparent since larger icon size options were added in Tracker 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: http://www.haiku-os.org/legacy-docs/bebook/BNodeInfo.html )

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.

There is also a GRAFX:Thumbnail attribute set, which includes a high quality (up to) 96px actual thumbnail version of the image. I've kept finding myself wondering why Tracker refuses to use this far superior thumbnail even when I'm using the largest icon size options.

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.

by jstressman, 11 years ago

Tracker as it is now, using the upscaled 8bit dithered 32px icons

by jstressman, 11 years ago

Tracker mockup using the full color 96px thumbnails from the GRAFX:Thumbnail attribute.

comment:2 by dsjonny, 11 years ago

+1

comment:3 by dsjonny, 11 years ago

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.

in reply to:  3 comment:4 by Giova84, 11 years ago

Replying to dsjonny:

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.

+11 :-)

comment:5 by Giova84, 10 years ago

Would be fine publish this ticket as GCI 2013 task :-) http://www.google-melange.com/gci/org/google/gci2013/haiku

comment:6 by pulkomandy, 9 years ago

Milestone: R1R2

comment:7 by diver, 9 years ago

Owner: changed from nobody to jscipione
Status: newassigned

comment:8 by Giova84, 9 years ago

I've seen that John seems to be at a good point about this feature :-)

http://insightfactory.tumblr.com/image/91811088137

comment:9 by jscipione, 9 years ago

Yes, I have gotten thumbnails to work by probing files, finding out their MIME types, filtering out the images in an approved list of MIME types using the Translation Kit, then I use the Translation Kit once again to create a thumbnail at the size of your current finder setting (16x16, 32x32, 40x40, 48x48, 64x64, 96x96, or 128x128) and the store the thumbnail(so) in one or more attributes on the file.

All of this works, all that remains for the feature to be complete is that when the user changes the file, the thumbnails must be updated at all sizes that have previously been computed.

comment:10 by danboid, 9 years ago

Hi John

This is my most wanted feature for the Tracker, above SMB and SFTP browsing. Have you made any progress on your Tracker thumbnailer with updating previews?

Does it work for video files too or just images?

Have you uploaded your code anywhere public yet?

Thanks

comment:11 by danboid, 9 years ago

Does your thumbnail preview code work for files on read-only partitions or drives such as CD and DVD-ROMs?

It would be good if it could fall back to storing thumbnails for read-only files on the Haiku drive somewhere.

comment:12 by jscipione, 9 years ago

@danboid

I haven't touched Tracker thumbnail support in a while. What I've done can be seen here: https://github.com/jscipione/haiku/tree/tracker_thumb

thumbnail preview will work for read-only partitions such as CD and DVD-ROMs but you won't be able to cache the resulting thumbnail in an attribute so the thumbnail will have to be recreated each time.

comment:13 by danboid, 9 years ago

So why did it never get merged? I presume you never finished it or else it would've been integrated right? Do you intend to finish this or have you given up on this feature?

Thanks

comment:14 by danboid, 9 years ago

Does it work for video files too or just images?

comment:15 by pulkomandy, 9 years ago

At the time, we thought it was better to first merge aldeck's tracker_refactoring branch (even older, 2010 or so) before further work on addding functionalities to Tracker, because the code was not very clean.

This has been done now, and the branch could be merged once it is brought up to date with current state of Tracker.

Previewing videos is difficult, a naive approach would be to decode the first frame but that is often completely black, so smarter code is needed. I think the thumbnail code is generic and will provide thumbnails for anything, as soon as there is a translator which can somehow turn the file data into a BBitmap. Then it is only a matter of writing the appropriate translators to preview anything you'd like.

comment:16 by diver, 9 years ago

I don't think that tracker_refactoring branch has been merged. I believe it's even impossible to do that now. Too bad that all the work is lost now :/

comment:17 by pulkomandy, 9 years ago

right, it was not strictly merged. Waddlesplash did try to salvage as much as he could from it when he switched Tracker to use the layout kit.

comment:18 by axeld, 9 years ago

No, actually, he left out the interesting parts, and only took over the stuff that has to do with the layout API. The long-overdue refactoring of Tracker has been omitted, unfortunately.

in reply to:  15 comment:19 by ttcoder, 8 years ago

Replying to pulkomandy:

Previewing videos is difficult, a naive approach would be to decode the first frame but that is often completely black, so smarter code is needed.

Stumbled on something that might help for this, while reading the ffmpeg man page (that thing is a real treasure trove!):

ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png

Tested on a couple videos, seems to work. Probably needs tweaking to make it read more than just 100 frames.

comment:20 by danboid, 6 years ago

This is still one of my most wanted missing features of Haiku but I'd imagine this might have to wait until post 1.0 now?

128x128 pixel thumbnails aren't much use when 4K displays are increasingly common so they'd really need to scale larger than that in order for it to be useful.

comment:21 by pulkomandy, 5 years ago

Blocking: 15107 added

comment:24 by pulkomandy, 3 years ago

Milestone: R2Unscheduled

comment:25 by jscipione, 3 years ago

Resolution: fixed
Status: assignedclosed

Implemented in hrev55348.

Note: See TracTickets for help on using tickets.