Liz::PictureSet::Picture - module for Picture objects of the PictureSet
use Liz::PictureSet; $pictureset = new Liz::PictureSet;
$picture = $pictureset->Picture; $picture = $pictureset->Picture( $pictureID );
$picture->update;
Provide object oriented access to pictures in a PictureSet. Usually not accessed directly, but rather through the Liz::PictureSet object and its Picture method.
Create a new Picture object from a PictureSet object.
1 Liz::PictureSet object 2 ID to created Picture object with (default: none = new picture)
1 instantiated object
It is not intended to call this method directly, but rather indirectly through the Liz::PictureSet module.
$pictureset = new Liz::PictureSet; $picture = $pictureset->Picture; $picture = $pictureset->Picture( $pictureID );
Update a Picture object in the Liz::PictureSet database.
1 ID with which the object was updated (undef = error)
$pictureID = $picture->update;
Delete a Liz::PictureSet::Picture object from the database.
1 flag: whether action was successful
$picture->delete;
The following methods allow you to inspect and/or change certain fields of the Liz::PictureSet::Picture object.
Return or set the Alt (alternate text) information of the Liz::PictureSet::Picture object.
1 new name value of the Alt (default: no change)
1 current/old name value of the Alt
$picture->Alt( $alt ); $alt = $picture->Alt;
Return or set the Author information of the Liz::PictureSet::Picture object.
1 new name value of the Author (default: no change)
1 current/old name value of the Author
$picture->Author( $author ); $author = $picture->Author;
Return the AuthorID information of the Liz::PictureSet::Picture object. It is usually easier and more transparant to use the Author method instead.
1 current value of the AuthorID
$authorID = $picture->AuthorID;
Return or set the Border information of the Liz::PictureSet::Picture object.
1 new value of the Border (default: no change)
1 current/old value of the Border
$picture->Border( $border ); $border = $picture->Border;
Return the number of bytes that are used for the graphics file.
1 number of bytes for the graphics file
$bytes = $picture->Bytes;
Return or set the Copyright information of the Liz::PictureSet::Picture object.
1 new name value of the Copyright (default: no change)
1 current/old name value of the Copyright
$picture->Copyright( $copyright ); $copyright = $picture->Copyright;
Return the CopyrightID information of the Liz::PictureSet::Picture object. It is usually easier and more transparant to use the Copyright method instead.
1 current value of the CopyrightID
$copyrightID = $picture->CopyrightID;
Return the Created timestamp of the Liz::PictureSet::Picture object.
1 current timestamp value of the Created date
$created = $picture->Created;
Return or set the Extension information of the Liz::PictureSet::Picture object.
1 new value of the Extension (default: no change)
1 current/old value of the Extension
$picture->Extension( 'gif' ); $extension = $picture->Extension;
Return or set the File information of the Liz::PictureSet::Picture object.
1 new value of the File (default: no change)
1 current/old value of the File
$picture->File( $file ); $file = $picture->File;
Return or set the Height information of the Liz::PictureSet::Picture object.
1 new value of the Height (default: no change)
1 current/old value of the Height
$picture->Height( $height ); $height = $picture->Height;
Return the ID of the Liz::PictureSet::Picture object.
1 current ID of the object
$ID = $picture->ID;
Return or set the Options information of the Liz::PictureSet::Picture object.
1 new name value of the Options (default: no change)
1 current/old name value of the Options
$picture->Options( $options ); $options = $picture->Options;
Return or set the Palette information of the Liz::PictureSet::Picture object.
1 new name value of the Palette (default: no change)
1 current/old name value of the Palette
$picture->Palette( $palette ); $palette = $picture->Palette;
Return the PaletteID information of the Liz::PictureSet::Picture object. It is usually easier and more transparant to use the Palette method instead.
1 current value of the PaletteID
$paletteID = $picture->PaletteID;
Return or set the Published timestamp of the Liz::PictureSet::Picture object.
1 new timestamp value of the Published date (default: no change)
1 current/old timestamp value of the Published date
$picture->Published( $published ); $published = $picture->Published;
Return or set the Status information of the Liz::PictureSet::Picture object.
1 new value of the Status (default: no change)
1 current/old value of the Status
$picture->Status( $status ); $status = $picture->Status;
Return the Updated timestamp of the Liz::PictureSet::Picture object.
1 current timestamp value of the Updated date
$updated = $picture->Updated;
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)
1 name of the field to check
1 number of bytes in the file (0 if failed)
$bytes = $picture->Uploaded( 'graphic' );
Return or set the Width information of the Liz::PictureSet::Picture object.
1 new value of the Width (default: no change)
1 current/old value of the Width
$picture->Width( $width ); $width = $picture->Width;
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.
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)
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)
1 number of bytes in the file (0 if failed)
The GD library is not included with the Liz::PictureSet::Picture module, and must therefore be -use-d seperately for this to work properly.
Return a GD::Image object for the picture associated with the object.
1 GD::Image object (if possible)
$myImage = $picture->GDImage;
The GD library is not included with the Liz::PictureSet::Picture module, and must therefore be -use-d seperately for this to work properly.
Elizabeth Mattijsen ( lizperl@INC.nl )
(C) 1998-1999 International Network Consultants
Put module name between quotes to fix obscure bug in Perl 5.005x under ModPerl in method GDColor.
Now no longer adds Exporter to ISA: it wasn't necessary.
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.
Added documentation for the Extension method: it had always been there but not been documented.
Method new also inherits field PACKAGEPARENTID from Liz::PictureSet.
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.
Fixed problem in method update which would not return the ID of the object if the object was not changed.
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
No inherits from Liz::PictureSet instead of Liz::SQL.
Method delete now correctly calls SUPER::delete method first.
First version of this true Perl module.