Shayton Equilibrium Kitchen Utensil 2003 User Manual

Page of 194
MediaScript Objects and Methods 43 
• 
• 
• 
Media Object
The Media object implements the many image processing features provided by MediaRich. 
A typical script creates one or more Media objects by either loading image data from a file 
or using the Media drawing methods.
Class Methods
There are static methods on the Media object. They have been added to the Media class, 
and include:
g e t F i l e I n f o ( )
The method returns data about the image or images contained in the specified file. It 
returns as much information as can be ascertained without “considerable processing time.” 
It is left for the implementor of each file format handler to determine what “considerable 
processing time” means, but what is normally returned is that information that can be 
obtained by reading a small portion (1-2K) of the file. The data is returned as a JavaScript 
object, where each value returned is a property of that object.      
The information returned by this method will vary from one file type to another. The only 
value that is guaranteed to be returned is the “Type” value. The “Type” value is the name 
of the file type of the file (such as tiff, jpeg, etc.)
The following values are returned by most file types (current exceptions are “.ai”, “.pct”, 
“.ps”, “.eps” and “.pdf” files):
   Width - the width of the image(s) contained in the file
   Height - the height of the image(s) contained in the file
   Format - the pixel format of the image(s) contained in the file
Other values that are returned by some file types are:
   XDpi - the horizontal resolution of the image(s)
   YDpi - the vertical resolution of the image(s)
   Frames - the number of frames in the file
   Layers - the number of layers in the file
Syntax
var fileInfo = Media.getFileInfo(name @ "tif/32bit.tif");
Parameters
The only parameter is the specified file name.