Media:Width
and Media:Height
attributes used by Haiku
(for the source, and both En and De versions). Added an HVIF icon for Haiku.
Updated documentation to html5 and using recent images from Haiku.Thumbnail is an application which creates thumbnails for image files. By default it overwrites the mini icon and the icon which are displayed in Tracker windows and creates an additional attribute for the image file which contains a larger thumbnail (with a maximum side length of 96 pixels) which may be used by other applications. Furthermore it creates two integer attributes containing the width and height of the original image. See here for a detailed description which attributes are created.
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:
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.
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.)
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.
This is the Thumbnail window after dropping the image file 0670.jpg 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:
Closing the preferences window doesn't change anything.
You can use 'hey' which has been written by Attila Mezei (or anything else that sends scripting messages) to script Thumbnail.
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".
Description of the suites:
B_DIRECT_SPECIFIER
only'*REV', '*REL', '*DEF', '*USE', '*SAV'
with the same functions
as the appropriate buttons (see last section).B_DIRECT_SPECIFIER
onlyB_GET_PROPERTY, B_SET_PROPERTY, '*USE'
for getting the value in use,
setting the displayed value and using the displayed value.bool
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)"
The format of the attributes which are created by Thumbnail is the following:
This is the standard mini icon displayed by the tracker.
BEOS:M:STD_ICON
'MICN'
This is the standard large icon displayed by the tracker.
BEOS:L:STD_ICON
'ICON'
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.
GRAFX:Thumbnail
B_MESSAGE_TYPE ('MSGG')
Flattened BMessage. The unflattened BMessage is a
BBitmap archive.
GRAFX:Width
B_INT32_TYPE ('LONG')
int32
GRAFX:Height
B_INT32_TYPE ('LONG')
int32
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:
// 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);
}
NOTE: There has been a change to the library: the type of
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.