History log of /haiku/src/build/libbe/storage/NodeInfo.cpp
Revision Date Author Comments
# 7f819534 05-Aug-2021 John Scipione <jscipione@gmail.com>

Tracker: Add thumbnail support

Define thumbnail attributes in Attributes.h:
Media:Thumbnail to store the thumbnail,
Media:Thumbnail:CreationTime to see if thumbs need to be regenerated.

Store 128x128 thumbnail in attribute, for icon sizes smaller than
128x128 down-scale the 128x128 thumbnail. Use B_FILTER_BITMAP_BILINEAR
to down-scale the image using the bilinear scaling algorithm which
creates nicer looking thumbnails than the default scaling algorithm.

Store thumbnails as WebP images which compress smaller than PNGs and
fit in the inode better at 128x128.

Check the file's modification time in GetFileIconFromAttr() and compare
it to the thumbnail creation time. If the file has not been modified
since the last time we generated thumbnails return the thumbnail from
the attribute, otherwise fetch a new thumbnail with GetThumbnailIcon().

Add "Generate image thumbnails" Tracker setting. Default is turned off
for now. To generate image thumbnails you must first turn this setting
on in Tracker Windows preferences.

Spawn a get_thumbnail() thread to generate thumbnails and retrieve them
later on from the window thread to fill out into the icon. This should
improve responsiveness of generating thumbnails from a folder with a
lot of images. The generator thread will write the thumbnail data to an
attribute if on writable BFS volume.

If not on writable BFS volume, the generator thread will send the data
back to the original thread through a port by calling write_port().

When the thread is finished creating the thumbnail it sends a message
back to the Tracker application thread to update the pose which
instructs the window thread to look for an thumbnail. It either finds a
thumbnail in an attribute, or picks up the thumbnail data that has been
sent through write_port() using read_port().

This works on both read-write and read-only BFS volumes but it still
depends on the presence of a BEOS:TYPE parameter to have been written
to the volume before it became read-only. Thumbnail generation does not
work on other read-only volumes for example an ISO-9660 CD, but it does
work on read-only BFS volumes for example the BeOS R5 CD.

Move BPrivate::CheckNodeIconHintPrivate() from BNodeInfo to Tracker
Model CheckNodeIconHint(). Create Model::CheckAppIconHint() and look
for a vector icon or mini and large icon in that method. Check that
the base type is directory, volume, trash, desktop, or if executable
call CheckAppIconHint().

Add 1 to temp_name to fix the following warning:
src/kits/tracker/FSUtils.cpp:2437:12: note: 'snprintf' output 3 or more
bytes (assuming 267) into a destination of size 266

Rename temp_name to tempName following our style guidelines. Use
strlcpy() and strlcat() instead of strcpy() to safely copy the string.
This fixes thumbnail generation on 64-bit Haiku.

Change-Id: I7f927a5a1f8cf65e4b1aa1e0eb55bbfae87fd969
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3163
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 58164f4a 26-Jul-2015 Adrien Destugues <pulkomandy@gmail.com>

PVS 122,123: useless checks.


# a8a03488 24-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Don't even try to use the BeOS compatible types on the build platform.
That's just leading to problems.
* Fixed various 64 bit warnings when building libbe_build.so. One of the more
serious issues, that might bite us, is that 64 bit Linux defines dev_t to
unsigned long, while Haiku code assumes that it is signed and 32 bit. We'll
see...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f69d34a7 24-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Updated headers/build/os/support/TypeConstants.h with the current
headers/os version and removed the now duplicate icon type constant
definitions from several sources.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24106 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ac88988 24-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed some minor warnings in the Linux build environment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19110 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 338b8dc3 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 58164f4a490e1a9d7bdef66621fb4a6055e19a96 26-Jul-2015 Adrien Destugues <pulkomandy@gmail.com>

PVS 122,123: useless checks.


# a8a03488b178618297ebb9bb958e3a41f800c7a5 24-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Don't even try to use the BeOS compatible types on the build platform.
That's just leading to problems.
* Fixed various 64 bit warnings when building libbe_build.so. One of the more
serious issues, that might bite us, is that 64 bit Linux defines dev_t to
unsigned long, while Haiku code assumes that it is signed and 32 bit. We'll
see...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f69d34a72cb4ca92bfe91b3e1720de6a6bc5b350 24-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Updated headers/build/os/support/TypeConstants.h with the current
headers/os version and removed the now duplicate icon type constant
definitions from several sources.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24106 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ac88988728209784b13ddcef33c29a1cfce52d0 24-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed some minor warnings in the Linux build environment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19110 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 338b8dc301721b1f472e8297a898d4eaa2f2ee3a 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96