Brian Phillips > WebService-Shutterstock > WebService::Shutterstock::LicensedImage

Download:
WebService-Shutterstock-0.006.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.006   Source  

NAME ^

WebService::Shutterstock::LicensedImage - Allows for interogating and saving a licensed image from the Shutterstock API

VERSION ^

version 0.006

SYNOPSIS ^

        my $licensed_image = $subscription->license_image(image_id => 59915404, size => 'medium');

        # retrieve the bytes of the file
        my $jpg_bytes = $licensed_image->download;

        # or, save the file to a valid filename
        $licensed_image->download(file => '/my/photos/my-pic.jpg');

        # or, specify the directory and the filename will reflect what the server specifies
        # (typically as something like shutterstock_59915404.jpg)
        my $path_to_file = $licensed_image->download(directory => '/my/photos');

ATTRIBUTES ^

photo_id

thumb_large_url

allotment_charge

download_url

METHODS ^

download

Downloads a licensed image. If no arguments are specified, the raw bytes of the file are returned. You can also specify a file OR a directory (one or the other) to save the file instead of returning the raw bytes (as demonstrated in the SYNOPSIS).

If a directory or file option is given, the path to the saved file is returned.

WARNING: files will be silently overwritten if an existing file of the same name already exists.

AUTHOR ^

Brian Phillips <bphillips@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 by Brian Phillips and Shutterstock, Inc. (http://shutterstock.com).

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: