The original image is left untouched, of course.
A preference panel allows you to select which attributes are actually written.
Thumbnail is accompanied by a Tracker add-on named MakeThumbnail which simply launches Thumbnail and sends the current selection to it.
The following image shows a Tracker window after Thumbnail has overwritten the icons of the image files (all images have been painted by Eric Hotz):
Furthermore Thumbnail requires libprefs.so from Jon Watte to
save its preferences. This shared library must be installed in the
home/config/lib folder or anywhere else the BeOS can find it.
(The Thumbnail distribution contains libprefs.so from the version 1.2.5
of the libprefs package.)
(Thumbnail requires a shared library named libThumbnail.so which
comes with the Thumbnail distribution and must be installed in the
home/config/lib folder or anywhere else the BeOS can find it.
This shared library may be used from other programs.
See below for further informations.)
You can then drop files
and/or folders on its window to create thumbnails for all dropped image files
which can be translated. Dropped folders are searched recursively.
The add-on MakeThumbnails should have been copied into
the home/config/add-ons/Tracker folder by the installer. If not you
can double-click it to open a dialog which lets you have it moved
automatically to the correct folder.
This is the Thumbnail window after dropping the image file
Card024.gif (by Eric Hotz) on it.
The preference window can be accessed by selecting the Preferences
menu item in the Thumbnail window.
On the "Thumbnail Creation" tab
you can mark if alerts telling that the format of a specific file
has not been understood shall be suppressed, if icons or the large
thumbnail shall be shown and/or written into attributes
(written icons/thumbnails are always shown), if the large thumbnail
shall be dithered to the 8 Bit color palette instead of being created as
true color image and if the resolution of the original image
shall be written into a width and height attribute.
On the "MIME Database" tab
you can mark if the MIME database shall be updated
each time Thumbnail is launched. This updating adds a width and a height
attribute to each subtype of image if not already present. This
makes it possible to view the width and height attributes of image files
with the Tracker.
Description of the buttons:
This is the standard mini icon displayed by the tracker.
Name:
This is the standard large icon displayed by the tracker.
Name:
The longest side of the thumbnail is 96 pixels long (or smaller if the
original image has been smaller). The other side is scaled with the
aspect of the original image. The thumbnail is a BBitmap which has been
archived into a BMessage which has been flattened and then been written
into the attribute. The color space of the BBitmap is either B_COLOR_8_BIT
(if dithering was checked) or B_RGB_32_BIT.
Name:
Name:
Name:
Requirements
Thumbnail uses the Translation Kit which is built into the BeOS.
It can create thumbnails only for image files whose format can be
translated by the handlers you have installed in
the home/config/add-ons/Translators folder.Creating Thumbnails
After each image of a selection has been processed, the created icons and the created
thumbnail are displayed. Pressing the Stop button interrupts the
processing of the following images.
The About menu item opens a window with information about the application.
Preferences
Closing the preferences window doesn't change anything.
Scripting
You can use 'hey' which has been written by Attila Mezei
(or anything else that sends scripting messages) to script Thumbnail.
Description of the suites:
To create thumbnails, send a standard B_REFS_RECEIVED
message. This is not a real scripting message, but can be sent by "hey":
hey Thumbnail load "file(full-path-to-file)"
Thumbnail has a property named "Preferences" which in
turn has a property named "Thumbnail Creation" (this is the grouping tab in the preferences
window). This property serves as a root group for preferences and understands the suite
named "suite/vnd.dragonfly-pref-group" in addition to the standard suite
"suite/vnd.Be-handler". The root group contains preferences or preference groups.
A preference understands the suite named "suite/vnd.dragonfly-pref" in addition to the
standard suite "suite/vnd.Be-handler", whereas a preference group just understands the
standard suite "suite/vnd.Be-handler".
suite/vnd.dragonfly-pref-root
Property name: label of the tab, i.e. "Thumbnail Creation"
Specifiers: B_DIRECT_SPECIFIER
only
Messages: '*REV', '*REL', '*DEF', '*USE', '*SAV'
with the same functions
as the appropriate buttons (see last section).
Data type: none
suite/vnd.dragonfly-pref
Property name: label of the preference, e.g. "Suppress Alerts" or "Show"
Specifiers: B_DIRECT_SPECIFIER
only
Messages: B_GET_PROPERTY, B_SET_PROPERTY, '*USE'
for getting the value in use,
setting the displayed value and using the displayed value.
Data type: bool
Examples:
Note the '*USE'
command. Without this, the new values won't be used!
hey Thumbnail get "Suppress Alerts" of "Thumbnail Creation" of Preferences
hey Thumbnail set "Suppress Alerts" of "Thumbnail Creation" of Preferences to true
hey Thumbnail set "Write" of "Mini Icon" of "Thumbnail Creation" of Preferences to false
hey Thumbnail '*USE' "Thumbnail Creation" of Preferences
hey Thumbnail load "file(/boot/optional/images/Fearless Leader)"
Attributes format
The format of the attributes which are created by Thumbnail is
the following:
BEOS:M:STD_ICON
Type: 'MICN'
BEOS:L:STD_ICON
Type: 'ICON'
GRAFX:Thumbnail
Type: B_MESSAGE_TYPE ('MSGG')
Format: Flattened BMessage. The unflattened BMessage is a
BBitmap archive.
GRAFX:Width
Type: B_INT32_TYPE ('LONG')
Format: int32
GRAFX:Height
Type: B_INT32_TYPE ('LONG')
Format: int32
Source Code and shared library
A shared library named libThumbnail.so is included, as well as the source
code to create this library. The library is used by the application Thumbnail
and may be used freely by your programs. Simply include the header file
Thumbnail.h which declares a class named DThumbnail and link with
libThumbnail.so.
The class DThumbnail lets
you easily create thumbnails from BBitmaps and read/write them from/into
file attributes. The following example shows its usage:
NOTE: There has been a change to the library: the type of
// bitmap is assumed to be a BBitmap-pointer of an image
// for which you want to create a thumbnail
// view is assumed to be a BView where you want to display
// the thumbnail
// ref is assumed to be an entry_ref to the file where the image
// comes from
bool dither = true; // the thumbnail will be dithered
DThumbnail thumbnail(bitmap, dither);
if (thumbnail->Bitmap()) // will be NULL if the thumbnail couldn't be created
{
view->DrawBitmap(thumbnail->Bitmap());
BNode node(&ref);
thumbnail->WriteThumbnailAttribute(&node);
thumbnail->WriteIconAttribute(&node);
thumbnail->WriteMiniIconAttribute(&node);
thumbnail->WriteResolutionAttributes(&node);
}
DThumbnail::cThumbnailSize
has been changed from int32
to enum
. This has been necessary due to a bug in the exporting
mechanism.
Copyright © 1997, 1998
Thorsten Seitz. All rights reserved.
Home page.
Your feedback is very much appreciated.