OCBNET-WebSprite
view release on metacpan or search on metacpan
# default image library
# pick easiest to install
my $gfx_module = 'GD';
# check if libraries are installed
if (eval { require GD })
{ $gfx_module = "GD" }
elsif (eval { require Graphics::Magick })
{ $gfx_module = "Graphics::Magick" }
elsif (eval { require Image::Magick })
{ $gfx_module = "Image::Magick" }
# if anyone knows a better way to do this, please elaborate :)
warn "Choosen gfx-lib <$gfx_module>\n";
# initialize custom module build object
my $builder = Module::Build::Custom->new(
module_name => 'OCBNET::WebSprite',
license => 'GPL_3',
dist_author => q{Marcel Greter <marcel.greter@ocbnet.ch>},
dist_abstract => 'WebSprite generator from annotated CSS',
OCBNET-WebSprite
================
Perl Package to generate spritesets from annotated css.
PREREQUISITE
============
You need GD, Image::Magick or Graphics::Magick installed!
INSTALL
=======
[](https://travis-ci.org/mgreter/OCBNET-WebSprite)
[](https://coveralls.io/r/mgreter/OCBNET-WebSprite?branch=master)
Standard process for building & installing modules:
```
lib/OCBNET/Image.pm view on Meta::CPAN
###################################################################################################
# Copyright 2013/2014 by Marcel Greter
# This file is part of OCBNET-WebSprite (GPL3)
####################################################################################################
package OCBNET::Image;
####################################################################################################
# implementation agnostic image library for OCBNET-WebSprite
# will either use GD, Image::Magick or Graphics::Magick
####################################################################################################
our $VERSION = '1.0.1';
####################################################################################################
use Carp;
use strict;
use warnings;
use vars qw(@ISA);
####################################################################################################
lib/OCBNET/Image.pm view on Meta::CPAN
my $module;
# check for pre-loaded module first
if (eval { $OCBNET::Image::GD::VERSION }) { $module = "gd" }
elsif (eval { $OCBNET::Image::GM::VERSION }) { $module = "gm" }
elsif (eval { $OCBNET::Image::IM::VERSION }) { $module = "im" }
# check for pre-loaded library next
elsif (eval { $GD::VERSION }) { $module = "gd" }
elsif (eval { $Graphic::Magick::VERSION }) { $module = "gm" }
elsif (eval { $Image::Magick::VERSION }) { $module = "im" }
# finally try to load an implementation on my own
elsif (eval { require OCBNET::Image::GD }) { $module = "gd" }
elsif (eval { require OCBNET::Image::GM }) { $module = "gm" }
elsif (eval { require OCBNET::Image::IM }) { $module = "im" }
# fatal error if no implementation was loaded
else { die "no graphic implementation found" }
# put the correct base class implementation into place
lib/OCBNET/Image/IM.pm view on Meta::CPAN
####################################################################################################
our $VERSION = '1.0.1';
####################################################################################################
use Carp;
use strict;
use warnings;
####################################################################################################
use Image::Magick;
use base qw(Image::Magick);
####################################################################################################
####################################################################################################
1;
( run in 0.254 second using v1.01-cache-2.11-cpan-beeb90c9504 )