Image-Placeholder

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

name:                Image-Placeholder
version:             v1.0.0
abstract:            generate images for use as placeholders
license:             ~
author:              
    - Mark Norman Francis <norm@cackhanded.net>
generated_by:        ExtUtils::MakeMaker version 6.42
distribution_type:   module
requires:     
    GD:                            0
    Modern::Perl:                  0
    Moose:                         0
    MooseX::FollowPBP:             0
    MooseX::Method::Signatures:    0
    Test::More:                    0
    version:                       0
meta-spec:
    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
    version: 1.3

Makefile.PL  view on Meta::CPAN


WriteMakefile(
    NAME                => 'Image::Placeholder',
    AUTHOR              => 'Mark Norman Francis <norm@cackhanded.net>',
    VERSION_FROM        => 'lib/Image/Placeholder.pm',
    ABSTRACT_FROM       => 'lib/Image/Placeholder.pm',
    PL_FILES            => {},
    EXE_FILES           => [ 'bin/placeholder' ],
    PREREQ_PM => {
        'Test::More'                 => 0,
        'Modern::Perl'               => 0,
        'version'                    => 0,
        'Moose'                      => 0,
        'MooseX::FollowPBP'          => 0,
        'MooseX::Method::Signatures' => 0,
        'GD'                         => 0,
    },
    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean               => { FILES => 'Image-Placeholder-*' },
);

README  view on Meta::CPAN

======================
Image::Placeholder is a module and command-line script for generating PNG
images which can be used as placeholders, most commonly when designing a
document or website which will accept images with fixed dimensions, but that
imagery is not yet available.


Dependencies
------------
- Perl v5.10 or better
- Modern::Perl
- Moose, MooseX::FollowPBP, MooseX::Method::Signatures
- GD

Copyright and licence
---------------------
Copyright (c) 2010 Mark Norman Francis <norm@cackhanded.net>.

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

bin/placeholder  view on Meta::CPAN

#!/usr/bin/env perl

use Modern::Perl;

use Getopt::Long;
use Image::Placeholder;
use Pod::Usage;



my %options = get_options_or_exit();
my $size    = shift;
my $text    = shift;

lib/Image/Placeholder.pm  view on Meta::CPAN

package Image::Placeholder;

use Modern::Perl;
use Moose;
use MooseX::Method::Signatures;
use MooseX::FollowPBP;

use GD;
use version;
our $VERSION = qv( 1.0.0 );

use constant TRUE_COLOUR      => 1;
use constant MAX_TRANSPARENCY => 127;

t/01.text.t  view on Meta::CPAN

use Modern::Perl;
use Test::More      tests => 3;

use Image::Placeholder;



{
    my $img = Image::Placeholder->new();
    ok( '300×300' eq $img->get_text() );
}

t/02.hex.t  view on Meta::CPAN

use Modern::Perl;
use Test::More      tests => 4;

use Image::Placeholder;


{
    my $img = Image::Placeholder->new();
    my @rgb = $img->rgb_to_hex( 'ffffff' );
    is_deeply( [ 255, 255, 255 ], \@rgb, 'white' );
}

t/03.sizes.t  view on Meta::CPAN

use Modern::Perl;
use Test::More      tests => 12;

use Image::Placeholder;



{
    my $img = Image::Placeholder->new();
    ok( 300 == $img->get_width,  'default width is 300' );
    ok( 300 == $img->get_height, 'default height is 300' );



( run in 0.571 second using v1.01-cache-2.11-cpan-a5abf4f5562 )