NAME

Liz::PictureSet::Picture - module for Picture objects of the PictureSet


SYNOPSIS

 use Liz::PictureSet;
 $pictureset = new Liz::PictureSet;

 $picture = $pictureset->Picture;
 $picture = $pictureset->Picture( $pictureID );

 $picture->update;


EXAMPLES


DESCRIPTION

Provide object oriented access to pictures in a PictureSet. Usually not accessed directly, but rather through the Liz::PictureSet object and its Picture method.


BASIC METHODS


new

Create a new Picture object from a PictureSet object.

Input Parameters

 1 Liz::PictureSet object
 2 ID to created Picture object with
   (default: none = new picture)
Output Parameters

 1 instantiated object
Note

It is not intended to call this method directly, but rather indirectly through the Liz::PictureSet module.

Example

 $pictureset = new Liz::PictureSet;
 $picture = $pictureset->Picture;
 $picture = $pictureset->Picture( $pictureID );


update

Update a Picture object in the Liz::PictureSet database.

Output Parameters

 1 ID with which the object was updated (undef = error)
Example

 $pictureID = $picture->update;


delete

Delete a Liz::PictureSet::Picture object from the database.

Output Parameters

 1 flag: whether action was successful
Example

 $picture->delete;


CONTENT METHODS

The following methods allow you to inspect and/or change certain fields of the Liz::PictureSet::Picture object.


Alt

Return or set the Alt (alternate text) information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new name value of the Alt
   (default: no change)
Output Parameters

 1 current/old name value of the Alt
Example

 $picture->Alt( $alt );
 $alt = $picture->Alt;


Author

Return or set the Author information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new name value of the Author
   (default: no change)
Output Parameters

 1 current/old name value of the Author
Example

 $picture->Author( $author );
 $author = $picture->Author;


AuthorID

Return the AuthorID information of the Liz::PictureSet::Picture object. It is usually easier and more transparant to use the Author method instead.

Output Parameters

 1 current value of the AuthorID
Example

 $authorID = $picture->AuthorID;


Border

Return or set the Border information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new value of the Border
   (default: no change)
Output Parameters

 1 current/old value of the Border
Example

 $picture->Border( $border );
 $border = $picture->Border;


Bytes

Return the number of bytes that are used for the graphics file.

Output Parameters

 1 number of bytes for the graphics file
Example

 $bytes = $picture->Bytes;


Copyright

Return or set the Copyright information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new name value of the Copyright
   (default: no change)
Output Parameters

 1 current/old name value of the Copyright
Example

 $picture->Copyright( $copyright );
 $copyright = $picture->Copyright;


CopyrightID

Return the CopyrightID information of the Liz::PictureSet::Picture object. It is usually easier and more transparant to use the Copyright method instead.

Output Parameters

 1 current value of the CopyrightID
Example

 $copyrightID = $picture->CopyrightID;


Created

Return the Created timestamp of the Liz::PictureSet::Picture object.

Output Parameters

 1 current timestamp value of the Created date
Example

 $created = $picture->Created;


Extension

Return or set the Extension information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new value of the Extension
   (default: no change)
Output Parameters

 1 current/old value of the Extension
Example

 $picture->Extension( 'gif' );
 $extension = $picture->Extension;


File

Return or set the File information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new value of the File
   (default: no change)
Output Parameters

 1 current/old value of the File
Example

 $picture->File( $file );
 $file = $picture->File;


Height

Return or set the Height information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new value of the Height
   (default: no change)
Output Parameters

 1 current/old value of the Height
Example

 $picture->Height( $height );
 $height = $picture->Height;


ID

Return the ID of the Liz::PictureSet::Picture object.

Output Parameters

 1 current ID of the object
Example

 $ID = $picture->ID;


Options

Return or set the Options information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new name value of the Options
   (default: no change)
Output Parameters

 1 current/old name value of the Options
Example

 $picture->Options( $options );
 $options = $picture->Options;


Palette

Return or set the Palette information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new name value of the Palette
   (default: no change)
Output Parameters

 1 current/old name value of the Palette
Example

 $picture->Palette( $palette );
 $palette = $picture->Palette;


PaletteID

Return the PaletteID information of the Liz::PictureSet::Picture object. It is usually easier and more transparant to use the Palette method instead.

Output Parameters

 1 current value of the PaletteID
Example

 $paletteID = $picture->PaletteID;


Published

Return or set the Published timestamp of the Liz::PictureSet::Picture object.

Input Parameters

 1 new timestamp value of the Published date
   (default: no change)
Output Parameters

 1 current/old timestamp value of the Published date
Example

 $picture->Published( $published );
 $published = $picture->Published;


Status

Return or set the Status information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new value of the Status
   (default: no change)
Output Parameters

 1 current/old value of the Status
Example

 $picture->Status( $status );
 $status = $picture->Status;


Updated

Return the Updated timestamp of the Liz::PictureSet::Picture object.

Output Parameters

 1 current timestamp value of the Updated date
Example

 $updated = $picture->Updated;


Uploaded

Set a number of fields in the object according to a file that was just uploaded with Liz::Perl, as specified by the name of the field in the script with which the file was uploaded.

The following fields will be automatically set when possible: 1 Title (the complete filename on the originating filesystem) 2 Extension (the extension of the uploaded file) 3 File (the contents of the uploaded file) 4 Width (the width of the picture in pixels) 5 Height (the height of the picture in pixels) 6 Palette (the type of palette used)

Input Parameters

 1 name of the field to check
Output Parameters

 1 number of bytes in the file
   (0 if failed)
Example

 $bytes = $picture->Uploaded( 'graphic' );


Width

Return or set the Width information of the Liz::PictureSet::Picture object.

Input Parameters

 1 new value of the Width
   (default: no change)
Output Parameters

 1 current/old value of the Width
Example

 $picture->Width( $width );
 $width = $picture->Width;


MANIPULATION METHODS

The Liz::PictureSet::Picture module does not contain any direct image manipulation methods, but does contain some interfaces with other image manipulation libraries/utilities such as the GD library.


GDColor

Set a number of fields in the object according to a GIF-file that is created using the GD module.

The following fields will be automatically set when possible: 1 Title (hexcode of colour) 2 Extension (always ``gif'') 3 File (the contents of the created GIF) 4 Width (the width of the picture in pixels) 5 Height (the height of the picture in pixels)

Input Parameters

 1 HexCode for the colour to create (as used in HTML, e.g. 'FF00FF')
   (default: 'FFFFFF' = white)
 2 width of image to create
   (default: 8)
 3 height of image to create
   (default: 8)
Output Parameters

 1 number of bytes in the file
   (0 if failed)
Note

The GD library is not included with the Liz::PictureSet::Picture module, and must therefore be -use-d seperately for this to work properly.


GDImage

Return a GD::Image object for the picture associated with the object.

Output Parameters

 1 GD::Image object (if possible)
Example

 $myImage = $picture->GDImage;
Note

The GD library is not included with the Liz::PictureSet::Picture module, and must therefore be -use-d seperately for this to work properly.


AUTHOR

Elizabeth Mattijsen ( lizperl@INC.nl )


COPYRIGHT

(C) 1998-1999 International Network Consultants


HISTORY

Version 0.27, 3 December 1999

Put module name between quotes to fix obscure bug in Perl 5.005x under ModPerl in method GDColor.

Version 0.26, 30 September 1999

Now no longer adds Exporter to ISA: it wasn't necessary.

Version 0.25, 26 September 1999

New method GDColor added. Similar to method Uploaded but instead of using the information of an uploaded file, it creates a GIF-image for a specified colour and uses that data to store in the Picture object.

Version 0.24, 2 September 1999

Added documentation for the Extension method: it had always been there but not been documented.

Method new also inherits field PACKAGEPARENTID from Liz::PictureSet.

Version 0.23, 20 August 1999

Updated methods new and update so that this module can be sub-classed with extra fields if necessary.

Updated method File so that it will not obtain the old file contents if it is not to be returned.

Fixed problem with delete, which would not remove the record from the database, but which would delete the file.

Updated source to new typography.

Version 0.22, 27 April 1999

Fixed problem in method update which would not return the ID of the object if the object was not changed.

Version 0.21, 15 April 1999

Fixed problem with Uploaded which would not set the changed flag which would cause the object to not be updated if it was the only action on the object

Version 0.2, 21 January 1999

No inherits from Liz::PictureSet instead of Liz::SQL.

Version 0.11, 31 December 1998

Method delete now correctly calls SUPER::delete method first.

Version 0.1, 30 December 1998

First version of this true Perl module.