|
NAMENet::Google::PicasaWeb::Media - hold information about a photo or videoVERSIONversion 0.11SYNOPSISmy @photos = $album->list_media_entries; for my $photo (@photos) { my $media_info = $photo->photo; print "Image Title: ", $media_info->title, "\n"; print "Image Description: ", $media_info->description, "\n\n"; my $main_photo = $media_info->content; print "Image URL: ", $main_photo->url, "\n"; print "Image MIME Type: ", $main_photo->mime_type, "\n"; print "Image Medium: ", $main_photo->medium, "\n"; print "Thumbnails:\n\n"; for my $thumbnail ($media_info->thumbnails) { print " Thumbnail URL: ", $thumbnail->url, "\n"; print " Thumbnail Dimensions: ", $thumbnail->width, "x", $thumbnail->height, "\n\n"; my $photo_data = $thumbnail->fetch; $thumbnail->fetch( file => 'thumbnail.jpg' ); } my $photo_data = $main_photo->fetch; $main_photo->fetch( file => 'photo.jpg' ); } DESCRIPTIONThis is where you will find information about the photos, videos, and thumbnails themselves. You can get information about them with this object, such as the URL that can be used to download the media file. This object (and its children) also provide some features to fetching this information.This class extends Net::Google::PicasaWeb::Base. ATTRIBUTEtitleThis is the title of the photo or video.descriptionThis is a description for the photo or video.contentThis is the main photo or video item attached to the media information entry. See "MEDIA CONTENT" below for information about the object returned.thumbnailsThis is an array of object containing information about the thumbnails that were attached when the photo was retrieved from the server. See "THUMBNAILS" below for information about these objects.METHODSfrom_feedBuilds a media class from a service object and reference to a "<media:group>" object in XML::Twig::Elt.MEDIA CONTENTThe object returned from the "content" accessor is an object with the following accessors and methods.ATTRIBUTESmediaThis is the parent Net::Google::PicasaWeb::Media object. url This is the URL where the photo or video may be downloaded from. mime_type This is the MIME-Type of the photo or video. medium This should be one of the following scalar values describing the media entry:
width The width of the photo in pixels. height The height of the photo in pixels. size The file size of the photo in bytes. METHODSfetchmy $data = $content->fetch(%params); Fetches the image or video from Picasa Web. By default, this method returns the file data as a scalar. This method accepts the following parameters, which modify this behavior:
THUMBNAILSEach thumbnail returned represents an individual image resource used as a thumbnail for the main item. Each one has the following attributes and methods.ATTRIBUTESmediaThis is the parent Net::Google::PicasaWeb::Media object. url This is the URL where the thumbnail image can be pulled down from. width This is the pixel width of the image. height This is the pixel height of the image. METHODSfetchmy $data = $thumbnail->fetch(%params); Fetches the thumbnail image from Picasa Web. By default, this method returns the image data as a scalar. This method accepts the following parameters, which modify this behavior:
AUTHORAndrew Sterling Hanenkamp <hanenkamp@cpan.org>COPYRIGHT AND LICENSEThis software is copyright (c) 2011 by Andrew Sterling Hanenkamp.This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Visit the GSP FreeBSD Man Page Interface. |