r5330 - in
/packages/libgd-securityimage-perl/branches/upstream/current:
Changes MANIFEST META.yml eg/demo.pl lib/GD/SecurityImage.pm
lib/GD/SecurityImage/Styles.pm t/04-backend.t t/06-version_magick.t
t/99-magick.t t/magick.pl
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Mon Apr 30 13:43:33 UTC 2007
Author: eloy
Date: Mon Apr 30 13:43:33 2007
New Revision: 5330
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5330
Log:
[svn-upgrade] Integrating new upstream version, libgd-securityimage-perl (1.64)
Added:
packages/libgd-securityimage-perl/branches/upstream/current/t/magick.pl
Modified:
packages/libgd-securityimage-perl/branches/upstream/current/Changes
packages/libgd-securityimage-perl/branches/upstream/current/MANIFEST
packages/libgd-securityimage-perl/branches/upstream/current/META.yml
packages/libgd-securityimage-perl/branches/upstream/current/eg/demo.pl
packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage.pm
packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage/Styles.pm
packages/libgd-securityimage-perl/branches/upstream/current/t/04-backend.t
packages/libgd-securityimage-perl/branches/upstream/current/t/06-version_magick.t
packages/libgd-securityimage-perl/branches/upstream/current/t/99-magick.t
Modified: packages/libgd-securityimage-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/Changes?rev=5330&op=diff
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/Changes (original)
+++ packages/libgd-securityimage-perl/branches/upstream/current/Changes Mon Apr 30 13:43:33 2007
@@ -1,6 +1,11 @@
Revision history for Perl extension GD::SecurityImage.
Time zone is GMT+2.
+
+1.64 Wed Apr 25 21:01:49 2007
+ => Yet another test suite update for Image::Magick.
+ => New style "blank" added for evil purposes.
+ => Fixed a regex in demo.pl
1.63 Sat Feb 24 16:41:03 2007
=> I didn't check the existence of Image::Magick in
Modified: packages/libgd-securityimage-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/MANIFEST?rev=5330&op=diff
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/MANIFEST (original)
+++ packages/libgd-securityimage-perl/branches/upstream/current/MANIFEST Mon Apr 30 13:43:33 2007
@@ -10,6 +10,7 @@
t/06-version_magick.t
t/98-gd.t
t/99-magick.t
+t/magick.pl
t/t.api
t/skip.test
eg/demo.pl
Modified: packages/libgd-securityimage-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/META.yml?rev=5330&op=diff
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/META.yml (original)
+++ packages/libgd-securityimage-perl/branches/upstream/current/META.yml Mon Apr 30 13:43:33 2007
@@ -1,6 +1,6 @@
---
name: GD-SecurityImage
-version: 1.63
+version: 1.64
author:
- 'Burak Gursoy <burak at cpan.org>'
abstract: Security image (captcha) generator.
@@ -14,7 +14,7 @@
provides:
GD::SecurityImage:
file: lib/GD/SecurityImage.pm
- version: 1.63
+ version: 1.64
GD::SecurityImage::GD:
file: lib/GD/SecurityImage/GD.pm
version: 1.50
@@ -23,7 +23,7 @@
version: 1.37
GD::SecurityImage::Styles:
file: lib/GD/SecurityImage/Styles.pm
- version: 1.20
+ version: 1.21
generated_by: Module::Build version 0.2805
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
Modified: packages/libgd-securityimage-perl/branches/upstream/current/eg/demo.pl
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/eg/demo.pl?rev=5330&op=diff
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/eg/demo.pl (original)
+++ packages/libgd-securityimage-perl/branches/upstream/current/eg/demo.pl Mon Apr 30 13:43:33 2007
@@ -25,7 +25,7 @@
# - - - - - - - - - - - - - - > S T A R T P R O G R A M < - - - - - - - - - - - - - - #
-$VERSION = '1.40';
+$VERSION = '1.41';
use constant REQUIREDMODS => qw(
DBI
@@ -67,6 +67,8 @@
};
}
+my $NOT_EXISTS = quotemeta "Object does not exist in the data store";
+
run() if not caller; # if you require this, you'll need to call demo::run()
sub TEST_FONT_EXISTENCE {
@@ -145,7 +147,7 @@
# IP and browser string to validate the session.
# It is also possible to put a timeout value for security_code key.
# But, all these and anything else are all beyond this demo...
- if ( $@ && $@ =~ m{ \A Object does not exist in the data store }xms ) {
+ if ( $@ && $@ =~ m{ \A $NOT_EXISTS }xms ) {
$create_ses->('new');
}
Modified: packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage.pm?rev=5330&op=diff
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage.pm (original)
+++ packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage.pm Mon Apr 30 13:43:33 2007
@@ -4,7 +4,7 @@
use GD::SecurityImage::Styles;
use Carp qw(croak);
-$VERSION = '1.63';
+$VERSION = '1.64';
sub import {
my $class = shift;
@@ -626,6 +626,10 @@
This is the combination of ellipse and circle styles. Draws both ellipses
and circles.
+=item B<blank>
+
+Draws nothing. See L</"OTHER USES">.
+
=back
I<Note>: if you have a (too) old version of GD, you may not be able
@@ -979,7 +983,6 @@
<td><img border="0" src="http://img521.imageshack.us/img521/7235/magickscramble03boxmb2.png" /></td>
</tr>
-
<tr><td colspan="2"> </td></tr>
<tr>
<td>Style: <b>circle</b>. Scrambled with a fixed angle.</td>
@@ -988,7 +991,7 @@
<tr>
<td><img border="0" src="http://img139.imageshack.us/img139/7227/magickscramblefixed04cihd4.png" /></td>
- <td><img border="0" src="http://img139.imageshack.us/img139/9484/magickscramblefixedinfooj6.png" /></td>
+ <td><img border="0" src="http://img440.imageshack.us/img440/2647/magickscramblefixed05elnz6.png" /></td>
</tr>
<tr><td colspan="2"> </td></tr>
@@ -1031,15 +1034,66 @@
</pre>
</p>
+<p>Images hosted by <a href="http://imageshack.us">ImageShack</a>.</p>
+
=end html
+=head2 OTHER USES
+
+C<GD::SecurityImage> drawing capabilities can also be used for
+I<counter image> generation or displaying arbitrary messages:
+
+ use CGI qw(header);
+ use GD::SecurityImage 1.64; # we need the "blank" style
+
+ my $font = "StayPuft.ttf";
+ my $rnd = "10.257"; # counter data
+
+ my $image = GD::SecurityImage->new(
+ width => 140,
+ height => 75,
+ ptsize => 30,
+ rndmax => 1, # keeping this low helps to display short strings
+ frame => 0, # disable borders
+ font => $font,
+ );
+
+ $image->random( $rnd );
+ # use the blank style, so that nothing will be drawn
+ # to distort the image.
+ $image->create( ttf => 'blank', '#CC8A00' );
+ $image->info_text(
+ text => 'You are visitor number',
+ ptsize => 10,
+ strip => 0,
+ color => '#0094CC',
+ );
+ $image->info_text(
+ text => '( c ) 2 0 0 7 m y s i t e',
+ ptsize => 10,
+ strip => 0,
+ color => '#d7d7d7',
+ y => 'down',
+ );
+
+ my($data, $mime, $random) = $image->out;
+
+ binmode STDOUT;
+ print header -type => "image/$mime";
+ print $data;
+
=begin html
<p>
-All images in this document are generously hosted by
-<a href="http://imageshack.us">ImageShack</a>
-<a href="http://imageshack.us"><img src="http://imageshack.us/img/imageshack.png" border="0" /></a>
+The generated graphic will be:
+<br/>
+<br/>
+<img src = "http://img101.imageshack.us/img101/4770/gdsicountered2.png"
+ border = "0"
+ alt = "Image Hosted by ImageShack.us" />
</p>
+
+<p>Image hosted by <a href="http://imageshack.us">ImageShack</a>.</p>
=end html
Modified: packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage/Styles.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage/Styles.pm?rev=5330&op=diff
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage/Styles.pm (original)
+++ packages/libgd-securityimage-perl/branches/upstream/current/lib/GD/SecurityImage/Styles.pm Mon Apr 30 13:43:33 2007
@@ -2,7 +2,7 @@
use strict;
use vars qw[$VERSION];
-$VERSION = '1.20';
+$VERSION = '1.21';
sub style_default {
$_[0]->_drcommon(" \ lines will be drawn ");
@@ -61,6 +61,8 @@
$self->style_ellipse(@_) if not $self->{DISABLED}{ellipse}; # GD < 2.07
$self->style_circle(@_);
}
+
+sub style_blank {}
sub _drcommon {
my $self = shift;
Modified: packages/libgd-securityimage-perl/branches/upstream/current/t/04-backend.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/t/04-backend.t?rev=5330&op=diff
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/t/04-backend.t (original)
+++ packages/libgd-securityimage-perl/branches/upstream/current/t/04-backend.t Mon Apr 30 13:43:33 2007
@@ -1,11 +1,12 @@
#!/usr/bin/env perl -w
use strict;
+use vars qw( $MAGICK_SKIP );
use Test;
use Cwd;
BEGIN {
- eval "require Image::Magick";
- my $skip = $@ ? "You don't have Image::Magick installed." : '';
+ do 't/magick.pl' || die "Can not include t/magick.pl: $!";
+
my %total = (
magick => 2,
gd => 2,
@@ -25,7 +26,7 @@
# test if we've loaded the right library
gd();
- $skip ? skip_magick() : magick();
+ $MAGICK_SKIP ? skip_magick() : magick();
exit;
sub gd {
@@ -37,6 +38,6 @@
$class->import( backend => 'Magick' ); ok( $class->new->raw->isa('Image::Magick') );
}
sub skip_magick {
- skip($skip . " Skipping...", sub{1}) for 1..$total{magick};
+ skip( $MAGICK_SKIP . " Skipping...", sub{1}) for 1..$total{magick};
}
}
Modified: packages/libgd-securityimage-perl/branches/upstream/current/t/06-version_magick.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/t/06-version_magick.t?rev=5330&op=diff
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/t/06-version_magick.t (original)
+++ packages/libgd-securityimage-perl/branches/upstream/current/t/06-version_magick.t Mon Apr 30 13:43:33 2007
@@ -1,29 +1,17 @@
#!/usr/bin/env perl -w
use strict;
+use vars qw( $MAGICK_SKIP );
use Test;
use Cwd;
BEGIN {
- eval "require Image::Magick;";
- my $skip;
-
- if ( $@ ) {
- $skip = "You don't have Image::Magick installed.";
- }
- elsif ($Image::Magick::VERSION lt '6.0.4') {
- $skip = "There may be a bug in your PerlMagick version's "
- ."($Image::Magick::VERSION) QueryFontMetrics() method. "
- ."Please upgrade to 6.0.4 or newer.";
- }
- else {
- $skip = '';
- }
+ do 't/magick.pl' || die "Can not include t/magick.pl: $!";
my $TOTAL = 6;
plan tests => $TOTAL;
- if ($skip) {
- skip($skip . " Skipping...", sub{1}) for 1..$TOTAL;
+ if ( $MAGICK_SKIP ) {
+ skip( $MAGICK_SKIP . " Skipping...", sub{1}) for 1..$TOTAL;
exit;
}
else {
Modified: packages/libgd-securityimage-perl/branches/upstream/current/t/99-magick.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/t/99-magick.t?rev=5330&op=diff
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/t/99-magick.t (original)
+++ packages/libgd-securityimage-perl/branches/upstream/current/t/99-magick.t Mon Apr 30 13:43:33 2007
@@ -1,24 +1,11 @@
#!/usr/bin/env perl -w
use strict;
-use vars qw( %API );
+use vars qw( %API $MAGICK_SKIP );
use Test;
use Cwd;
BEGIN {
- eval "require Image::Magick;";
- my $skip;
-
- if ( $@ ) {
- $skip = "You don't have Image::Magick installed.";
- }
- elsif ($Image::Magick::VERSION lt '6.0.4') {
- $skip = "There may be a bug in your PerlMagick version's "
- ."($Image::Magick::VERSION) QueryFontMetrics() method. "
- ."Please upgrade to 6.0.4 or newer.";
- }
- else {
- $skip = '';
- }
+ do 't/magick.pl' || die "Can not include t/magick.pl: $!";
%API = (
magick => 6,
@@ -34,8 +21,8 @@
plan tests => $total;
- if ($skip) {
- skip($skip . " Skipping...", sub{1}) for 1..$total;
+ if ( $MAGICK_SKIP ) {
+ skip( $MAGICK_SKIP . " Skipping...", sub{1}) for 1..$total;
exit;
}
else {
Added: packages/libgd-securityimage-perl/branches/upstream/current/t/magick.pl
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libgd-securityimage-perl/branches/upstream/current/t/magick.pl?rev=5330&op=file
==============================================================================
--- packages/libgd-securityimage-perl/branches/upstream/current/t/magick.pl (added)
+++ packages/libgd-securityimage-perl/branches/upstream/current/t/magick.pl Mon Apr 30 13:43:33 2007
@@ -1,0 +1,19 @@
+use strict;
+use vars qw($MAGICK_SKIP);
+BEGIN {
+ eval "require Image::Magick;";
+ if ( $@ ) {
+ $MAGICK_SKIP = "You don't have Image::Magick installed.";
+ $MAGICK_SKIP .= " $@";
+ }
+ elsif ( $Image::Magick::VERSION lt '6.0.4') {
+ $MAGICK_SKIP = "There may be a bug in your PerlMagick version's "
+ . "($Image::Magick::VERSION) QueryFontMetrics() method. "
+ . "Please upgrade to 6.0.4 or newer.";
+ }
+ else {
+ $MAGICK_SKIP = '';
+ }
+}
+
+1;
More information about the Pkg-perl-cvs-commits
mailing list