 Copyright (c) Oracle Corporation 1999. All Rights Reserved.

  NAME
     	README.txt -  ORACLE interMedia Demo

			=======================

Contents
=======================
        Introduction
        About the Demo
        Setup and Build the Demo
        Running the Demo

Introduction
============
This README.txt file describes the steps required to build and run the 
interMedia image demo.

The interMedia image demo files are located in
<ORACLE_HOME>/ord/img/demo (on UNIX), and 
<ORACLE_HOME>\ord\img\demo (on Windows NT), where 
<ORACLE_HOME> is the ORACLE_HOME directory.

About the Demo
==============
The file imgdemo is a sample program that shows how Oracle8i interMedia image
can be used from within a program. The demo is written in C and uses OCI, 
Oracle Call Interface, to access the database and exercise Oracle8i interMedia
image. 

The program operates on imgdemo.dat, which is a bitmap (BMP) image in the demo
directory. Optionally, you can supply an image file name on the command line, 
provided the file resides in the same directory as the demo. In either case, 
once the image has been manipulated by Oracle8i interMedia image, the 
resulting image is written to the file imgdemo.out and can then be viewed with
common rendering tools.

When the demo is run, it deletes and re-creates a table named IMGDEMOTAB in 
the SCOTT/TIGER schema of the default database. This table is used to hold
the demo data. Once the table is created, a reference to the image file is
inserted into the table. The data is then loaded into the table and converted
to JFIF using the processCopy( ) method of ORDImage. 

The image properties are then extracted with the setProperties method. An 
UPDATE command is issued after the setProperties invocation to update the 
type attributes in the database.   

Next, the Oracle8i interMedia image process( ) method is used to cut and 
scale the image within the database.  The program cuts a portion of the 
image 100 pixels wide by 100 pixels high starting from pixel location 
(100,100).  This subimage is scaled to twice its original size and the 
resulting image is written out to the file system in a file named imgdemo.out.

Upon completion, the demo program leaves the imgdemo.out file in the current 
directory. It also leaves the table IMGDEMOTAB in the SCOTT/TIGER schema of 
the database. 


Setup and Build the Demo
========================

1) The Oracle interMedia Image demo uses the SCOTT/TIGER database user.
    If this user does not exist, you must create it:

    Start Server Manager. (svrmgrl on UNIX and Windows NT)

->  % svrmgrl

    Connect to the database with the SYS user: 

->  SVRMGRL> connect SYS/<SYS_PASSWORD> as SYSDBA;

    where <SYS_PASSWORD> is the password for the SYS
    user.

    Create the SCOTT user.

->  SVRMGRL> create user SCOTT identified by tiger;
->  SVRMGRL> grant connect,resource to SCOTT;
->  SVRMGRL> exit;

2) Create the image demo directory:

    Start Server Manager. (svrmgrl on UNIX and Windows NT)

->  % svrmgrl

    Connect to the database with the SYS user: 

->  SVRMGRL> connect SYS/<SYS_PASSWORD> as SYSDBA;

    where <SYS_PASSWORD> is the password for the SYS
    user.

    Create the image demo directory:

    on UNIX:
->  SVRMGRL> create or replace directory imgdemodir 
             as '<ORACLE_HOME>/ord/img/demo';

    on Windows NT:
    SVRMGRL> create or replace directory imgdemodir
             as '<ORACLE_HOME>\ord\img\demo';

    where <ORACLE_HOME> is the ORACLE_HOME directory

3) Grant privileges on the directory to PUBLIC:
 
    SVRMGRL> grant read on directory imgdemodir to public with grant option;

4) Make the imgdemo program. 

    On most UNIX systems:

->  % cd <ORACLE_HOME>/ord/img/demo
->  % make -f demo_ordimg.mk imgdemo

    On Windows NT

->  % cd <ORACLE_HOME>/ord/img/demo
->  % make.bat

    This is operating system specific. See the installation and 
    configuration guide for your operating system for details on how
    to make this program on your operating system.


Running the Demo
================

Execute the demo by typing imgdemo on the command line. Optionally, an image 
other than imgdemo.dat can be used in the demo by first copying the file to
the directory in which the demo resides and then specifying its file name on 
the command line as an argument to imgdemo. 

Use the following command: 

   $ imgdemo <optional-image-filename>


The demo displays a number of messages describing its progress, along with
any errors encountered in the event that something was not set up correctly. 
Expect to see the following messages: 

Dropping table IMGDEMOTAB... 
Creating and populating table IMGDEMOTAB... 
Loading data into cartridge... 
Modifying image characteristics... 
Writing image to file imgdemo.out... 
Disconnecting from database... 
Logged off and detached from server. 
Demo completed successfully. 

If the program encounters any errors, it is likely that either Oracle8i 
interMedia software has not been installed correctly or the database has 
not been started. If the program completes successfully, the original 
image and the resultant image, which has undergone the cutting and scaling 
described earlier, can be viewed with common image rendering tools.

=======================
END OF README.txt
