WebService::Shutterstock::LicensedImage - Allows for interogating and saving a licensed image from the Shutterstock API
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');
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).
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.
Brian Phillips <firstname.lastname@example.org>
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.