NAME
Net::Google::PicasaWeb::Media - hold information about a photo or video
VERSION
version 0.12
SYNOPSIS
my @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' );
}
DESCRIPTION
This 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.
ATTRIBUTE
title
This is the title of the photo or video.
description
This is a description for the photo or video.
content
This is the main photo or video item attached to the media information entry. See "MEDIA CONTENT" below for information about the object returned.
thumbnails
This 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.
METHODS
from_feed
Builds a media class from a service object and reference to a <media:group>
object in XML::Twig::Elt.
MEDIA CONTENT
The object returned from the "content" accessor is an object with the following accessors and methods.
ATTRIBUTES
media
This 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:
image
video
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.
METHODS
fetch
my $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:
- file
-
If given, the data will not be returned, but saved to the named file instead.
THUMBNAILS
Each thumbnail returned represents an individual image resource used as a thumbnail for the main item. Each one has the following attributes and methods.
ATTRIBUTES
media
This 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.
METHODS
fetch
my $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:
- file
-
If given, the data will not be returned, but saved to the named file instead.
AUTHOR
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 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.