Bing::Search::Result::Image - An image result


Bing-Search documentation Contained in the Bing-Search distribution.

Index


Code Index:

NAME

Top

Bing::Search::Result::Image - An image result

METHODS

Top

Width

The width, in pixels, of the image.

Height

The height, in pixels, of the image.

FileSize

The size, in bytes, of the image.

DisplayUrl

A URI object containing the URL (possibly modified for display) typically used to display the full-sized image.

MediaUrl

A URI object containing the URL typically used to display the full-sized image.

ContentType

The type of image, usually simply the file extension, though may also be a MIME type notation.

Title

A string containing the title of the image.

Url

A URI object containing the URI to the image.

Thumbnail

Returns a Bing::Search::Result::Image::Thumbnail object. It is very similar to this object. A thumbnail has a Width and Height, a ContentType, a FileSize, and a Url, all of which describe the thumbnail instead of the full-sized image.


Bing-Search documentation Contained in the Bing-Search distribution.

package Bing::Search::Result::Image;
use Moose;
use Bing::Search::Result::Image::Thumbnail;

extends 'Bing::Search::Result';

with 'Bing::Search::Role::Types::UrlType';

with 'Bing::Search::Role::Result::Width';
with 'Bing::Search::Role::Result::FileSize';
with 'Bing::Search::Role::Result::DisplayUrl';
with 'Bing::Search::Role::Result::Height';
with 'Bing::Search::Role::Result::MediaUrl';
with 'Bing::Search::Role::Result::Title';
with 'Bing::Search::Role::Result::ContentType';
with 'Bing::Search::Role::Result::Url';


has 'Thumbnail' => ( is => 'rw', isa => 'Bing::Search::Result::Image::Thumbnail' );

before '_populate' => sub { 
   my $self = shift;
   my $data = $self->data;
   my $t = Bing::Search::Result::Image::Thumbnail->new;
   my $thumbdata = delete $data->{Thumbnail};
   $t->data( $thumbdata );
   $t->_populate();
   $self->Thumbnail( $t );
};

__PACKAGE__->meta->make_immutable;