Hello community,
here is the log from the commit of package perl-Image-Size
checked in at Thu Jun 22 18:32:41 CEST 2006.
--------
--- perl-Image-Size/perl-Image-Size.changes 2006-01-25 21:39:47.000000000 +0100
+++ perl-Image-Size/perl-Image-Size.changes 2006-06-22 10:14:32.000000000 +0200
@@ -1,0 +2,9 @@
+Thu Jun 22 10:14:05 CEST 2006 - kssingvo@suse.de
+
+- upgrade to version 3.0. New features:
+- delay of Image::Magick loading until it is needed
+- additional installation tests
+- FlashMX (Shockwave Flash Ver. 6) support
+- image size of gif is now controlled by additional flag
+
+-------------------------------------------------------------------
Old:
----
Image-Size-2.992.tar.bz2
New:
----
Image-Size-3.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Image-Size.spec ++++++
--- /var/tmp/diff_new_pack.UPgeMB/_old 2006-06-22 18:32:35.000000000 +0200
+++ /var/tmp/diff_new_pack.UPgeMB/_new 2006-06-22 18:32:35.000000000 +0200
@@ -1,23 +1,24 @@
#
-# spec file for package perl-Image-Size (Version 2.992)
+# spec file for package perl-Image-Size (Version 3.0)
#
-# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
-# Please submit bugfixes or comments via http://www.suse.de/feedback/
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: perl-Image-Size
License: Artistic License
+BuildRequires: perl-Compress-Zlib
Group: Development/Libraries/Perl
Requires: perl = %{perl_version}
Autoreqprov: on
Summary: A Perl Module to deal with Dimensions of an Image in Several Popular Formats
-Version: 2.992
-Release: 124
+Version: 3.0
+Release: 1
Source: Image-Size-%{version}.tar.bz2
URL: http://www.cpan.org/authors/id/R/RJ/RJRAY
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -70,6 +71,12 @@
%doc README README.Win32
%changelog -n perl-Image-Size
+* Thu Jun 22 2006 - kssingvo@suse.de
+- upgrade to version 3.0. New features:
+- delay of Image::Magick loading until it is needed
+- additional installation tests
+- FlashMX (Shockwave Flash Ver. 6) support
+- image size of gif is now controlled by additional flag
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Sep 28 2005 - dmueller@suse.de
++++++ Image-Size-2.992.tar.bz2 -> Image-Size-3.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/ChangeLog new/Image-Size-3.0/ChangeLog
--- old/Image-Size-2.992/ChangeLog 2003-07-21 08:36:42.000000000 +0200
+++ new/Image-Size-3.0/ChangeLog 2006-06-10 08:40:01.000000000 +0200
@@ -1,5 +1,27 @@
CHANGE HISTORY
+Changes in 3.0:
+
+* Added test suites for POD correctness and POD coverage.
+
+* Implemented and documented a flag called $Image::Size::GIF_BEHAVIOR that
+ controls whether the GIF code returns the screensize, the first sub-image
+ or the largest of the sub-images.
+
+* Applied a patch from mrj@mrj.spb.ru to fix usage of the Compress::Zlib
+ module in the handling of compressed flash files. Added a new SWF file to
+ test this, and added reference to the file in MANIFEST and t/all.t.
+
+* Delay Image::Magick loading until it is needed. (Mark Stosberg).
+ Add support for Graphics::Magick as an alternative to Image::Magick.
+ If either Graphics::Magick or Image::Magick is loaded into memory
+ that module will be used. Otherwise, they are both tried to be loaded,
+ with Graphics::Magick being tried first. (Mark Stosberg). This patch also
+ adds a new test suite, t/magick.t, to the distribution and modifies both
+ MANIFEST and Makefile.PL (to add a build-dependancy on Test::More).
+
+* With Test::More now required for building, converted t/all.t to use it.
+
Changes in 2.992:
* Added support for FlashMX (Shockwave Flash ver. 6), as contributed by
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/MANIFEST new/Image-Size-3.0/MANIFEST
--- old/Image-Size-2.992/MANIFEST 2001-09-19 05:12:54.000000000 +0200
+++ new/Image-Size-3.0/MANIFEST 2006-06-10 10:53:54.000000000 +0200
@@ -6,6 +6,9 @@
Size.pm the code
imgsize Utility script
t/all.t test suite
+t/magick.t
+t/pod.t
+t/pod_coverage.t
t/letter_T.jpg Support files for tests
t/pak38.jpg
t/test.gif
@@ -18,3 +21,5 @@
t/bexjdic.tif
t/yasp.swf
t/468x60.psd
+t/8.swf
+META.yml Module meta-data (added by MakeMaker)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/META.yml new/Image-Size-3.0/META.yml
--- old/Image-Size-2.992/META.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/Image-Size-3.0/META.yml 2006-06-10 10:53:54.000000000 +0200
@@ -0,0 +1,12 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
+name: Image-Size
+version: 3.0
+version_from: Size.pm
+installdirs: site
+requires:
+ File::Spec: 0
+ Test::More: 0
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.30
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/Makefile.PL new/Image-Size-3.0/Makefile.PL
--- old/Image-Size-2.992/Makefile.PL 2001-08-11 11:03:06.000000000 +0200
+++ new/Image-Size-3.0/Makefile.PL 2006-06-10 08:01:35.000000000 +0200
@@ -8,7 +8,7 @@
(ABSTRACT => 'A library to extract height/width from images',
AUTHOR => 'Randy J. Ray (rjray@blackperl.com)') : ()),
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' },
- PREREQ_PM => { File::Spec => 0 },
+ PREREQ_PM => { File::Spec => 0, Test::More => 0, },
EXE_FILES => ['imgsize'],
clean => { FILES =>
'Image-Size-* *.spec *.rpm rpmrc rpmmacro' },
@@ -20,7 +20,7 @@
my $text = shift->SUPER::tools_other(@_);
- "$text\nECHO=\@echo\nRPM=rpm\n";
+ "$text\nECHO=echo\nRPM=rpm\n";
}
sub MY::post_constants
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/README new/Image-Size-3.0/README
--- old/Image-Size-2.992/README 2003-07-21 08:38:59.000000000 +0200
+++ new/Image-Size-3.0/README 2006-06-10 08:44:33.000000000 +0200
@@ -1,6 +1,6 @@
Image::Size - Determine the size of images in several common formats
-Version: 2.992 (See CHANGES below)
+Version: 3.0 (See CHANGES below)
WHAT IS IT
@@ -74,5 +74,22 @@
CHANGES
-* Added support for FlashMX (Shockwave Flash ver. 6), as contributed by
- Victor L Kuriashkin .
+Added test suites for POD correctness and POD coverage.
+
+Implemented and documented a flag called $Image::Size::GIF_BEHAVIOR that
+controls whether the GIF code returns the screensize, the first sub-image
+or the largest of the sub-images.
+
+Applied a patch from mrj@mrj.spb.ru to fix usage of the Compress::Zlib
+module in the handling of compressed flash files. Added a new SWF file to
+test this, and added reference to the file in MANIFEST and t/all.t.
+
+Delay Image::Magick loading until it is needed. (Mark Stosberg).
+Add support for Graphics::Magick as an alternative to Image::Magick.
+If either Graphics::Magick or Image::Magick is loaded into memory
+that module will be used. Otherwise, they are both tried to be loaded,
+with Graphics::Magick being tried first. (Mark Stosberg). This patch also
+adds a new test suite, t/magick.t, to the distribution and modifies both
+MANIFEST and Makefile.PL (to add a build-dependancy on Test::More).
+
+With Test::More now required for building, converted t/all.t to use it.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/Size.pm new/Image-Size-3.0/Size.pm
--- old/Image-Size-2.992/Size.pm 2003-07-21 08:48:47.000000000 +0200
+++ new/Image-Size-3.0/Size.pm 2006-06-10 08:05:15.000000000 +0200
@@ -17,55 +17,32 @@
package Image::Size;
-require 5.002;
+require 5.6.0;
use strict;
+use bytes;
use Cwd ();
use File::Spec ();
use Symbol ();
use AutoLoader 'AUTOLOAD';
require Exporter;
-use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $revision $VERSION $NO_CACHE
- %PCD_MAP $PCD_SCALE $read_in $last_pos *imagemagick_size);
+
+our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $revision, $VERSION, $NO_CACHE,
+ $GIF_BEHAVIOR, %PCD_MAP, $PCD_SCALE, $read_in, $last_pos);
BEGIN
{
@ISA = qw(Exporter);
@EXPORT = qw(imgsize);
- @EXPORT_OK = qw(imgsize html_imgsize attr_imgsize $NO_CACHE $PCD_SCALE);
+ @EXPORT_OK = qw(imgsize html_imgsize attr_imgsize $NO_CACHE $PCD_SCALE
+ $GIF_BEHAVIOR);
%EXPORT_TAGS = ('all' => [ @EXPORT_OK ]);
- $revision = q$Id: Size.pm,v 1.35 2003/07/21 06:48:47 rjray Exp $;
- $VERSION = "2.992";
+ $VERSION = "3.0";
- # Check if we have Image::Magick available
- eval {
- local $SIG{__DIE__}; # protect against user installed die handlers
- require Image::Magick;
- };
- if ($@) {
- *imagemagick_size =
- sub
- {
- (undef, undef, "Data stream is not a known image file format");
- };
- } else {
- *imagemagick_size =
- sub
- {
- my ($file_name) = @_;
- my $img = Image::Magick->new();
- my $x = $img->Read($file_name);
- # Image::Magick error handling is a bit weird, see
- # http://www.simplesystems.org/ImageMagick/www/perl.html#erro
- if("$x") {
- return (undef, undef, "$x");
- } else {
- return ($img->Get('width', 'height', 'format'));
- }
- };
- }
+ # Default behavior for GIFs is to return the "screen" size
+ $GIF_BEHAVIOR = 0;
}
@@ -260,6 +237,54 @@
return (wantarray) ? ($x, $y, $id) : ();
}
+sub imagemagick_size {
+ my $module_name;
+ # First see if we have already loaded Graphics::Magick or Image::Magick
+ # If so, just use whichever one is already loaded.
+ if (exists $INC{'Graphics/Magick.pm'}) {
+ $module_name = 'Graphics::Magick';
+ }
+ elsif (exists $INC{'Image/Magick.pm'}) {
+ $module_name = 'Image::Magick';
+ }
+
+ # If neither are already loaded, try loading either one.
+ elsif ( _load_magick_module('Graphics::Magick') ) {
+ $module_name = 'Graphics::Magick';
+ }
+ elsif ( _load_magick_module('Image::Magick') ) {
+ $module_name = 'Image::Magick';
+ }
+
+ if ($module_name) {
+ my ($file_name) = @_;
+ my $img = $module_name->new();
+ my $x = $img->Read($file_name);
+ # Image::Magick error handling is a bit weird, see
+ # http://www.simplesystems.org/ImageMagick/www/perl.html#erro
+ if("$x") {
+ return (undef, undef, "$x");
+ } else {
+ return ($img->Get('width', 'height', 'format'));
+ }
+
+ }
+ else {
+ return (undef, undef, "Data stream is not a known image file format");
+ }
+}
+
+# load Graphics::Magick or Image::Magick if one is not already loaded.
+sub _load_magick_module {
+ my $module_name = shift;
+ eval {
+ local $SIG{__DIE__};
+ require $module_name;
+ };
+ return !$@;
+}
+
+
sub html_imgsize
{
my @args = imgsize(@_);
@@ -289,6 +314,8 @@
eof $stream;
}
+# Simple converter-routine used by SWF and CWS code
+sub _bin2int { unpack("N", pack("B32", substr("0" x 32 . shift, -32))); }
=head1 NAME
@@ -423,7 +450,7 @@
=item SWF (ShockWave/Flash)
-=item SWC (FlashMX, compressed SWF, Flash 6)
+=item CWS (FlashMX, compressed SWF, Flash 6)
=item PCD (Kodak PhotoCD, see notes below)
@@ -505,6 +532,55 @@
portrait or landscape. That is in fact all that the library extracts from the
image file.
+=head2 Controlling Behavior with GIF Images
+
+GIF images present a sort of unusual situation when it comes to reading size.
+Because GIFs can be a series of sub-images to be isplayed as an animated
+sequence, what part does the user want to get the size for?
+
+When dealing with GIF files, the user may control the behavior by setting the
+global value B<$Image::Size::GIF_BEHAVIOR>. Like the PCD setting, this may
+be imported when loading the library. Three values are recognized by the
+GIF-handling code:
+
+=over 4
+
+=item 0
+
+This is the default value. When this value is chosen, the returned dimensions
+are those of the "screen". The "screen" is the display area that the GIF
+declares in the first data block of the file. No sub-images will be greater
+than this in size; if they are, the specification dictates that they be
+cropped to fit within the box.
+
+This is also the fastest method for sizing the GIF, as it reads the least
+amount of data from the image stream.
+
+=item 1
+
+If this value is set, then the size of the first sub-image within the GIF is
+returned. For plain (non-animated) GIF files, this would be the same as the
+screen (though it doesn't have to be, strictly-speaking).
+
+When the first image descriptor block is read, the code immediately returns,
+making this only slightly-less efficient than the previous setting.
+
+=item 2
+
+If this value is chosen, then the code loops through all the sub-images of the
+animated GIF, and returns the dimensions of the largest of them.
+
+This option requires that the full GIF image be read, in order to ensure that
+the largest is found.
+
+=back
+
+Any value outside this range will produce an error in the GIF code before any
+image data is read.
+
+The value of dimensions other than the view-port ("screen") is dubious.
+However, some users have asked for that functionality.
+
=head1 DIAGNOSTICS
The base routine, C<imgsize>, returns B<undef> as the first value in its list
@@ -555,8 +631,7 @@
=head1 SEE ALSO
-Chttp://www.tardis.ed.ac.uk/~ark/wwwis/ for a description of C<wwwis>
-and how to obtain it, LImage::Magick.
+The BImage::Magick and BImage::Info Perl modules at CPAN.
=head1 AUTHORS
@@ -597,7 +672,7 @@
{
my $stream = shift;
- my ($cmapsize, $buf, $h, $w, $x, $y, $type);
+ my ($cmapsize, $buf, $sh, $sw, $h, $w, $x, $y, $type);
my $gif_blockskip = sub {
my ($skip, $type) = @_;
@@ -617,12 +692,23 @@
}
};
+ return (undef, undef,
+ 'Out-of-range value for $Image::Size::GIF_BEHAVIOR: ' .
+ $Image::Size::GIF_BEHAVIOR)
+ if ($Image::Size::GIF_BEHAVIOR > 2);
+
+ # Skip over the identifying string, since we already know this is a GIF
$type = &$read_in($stream, 6);
if (length($buf = &$read_in($stream, 7)) != 7 )
{
return (undef, undef, "Invalid/Corrupted GIF (bad header)");
}
- ($x) = unpack("x4 C", $buf);
+ ($sw, $sh, $x) = unpack("vv C", $buf);
+ if ($Image::Size::GIF_BEHAVIOR == 0)
+ {
+ return ($sw, $sh, 'GIF');
+ }
+
if ($x & 0x80)
{
$cmapsize = 3 * (2**(($x & 0x07) + 1));
@@ -633,13 +719,28 @@
}
}
+ # Before we start this loop, set $sw and $sh to 0s and use them to track
+ # the largest sub-image in the overall GIF.
+ $sw = $sh = 0;
+
FINDIMAGE:
while (1)
{
if (&img_eof($stream))
{
- return (undef, undef,
- "Invalid/Corrupted GIF (at EOF w/o Image Descriptors)");
+ # At this point, if we haven't returned then the user wants the
+ # largest of the sub-images. So, if $sh and $sw are still 0s, then
+ # we didn't see even one Image Descriptor block. Otherwise, return
+ # those two values.
+ if ($sw and $sh)
+ {
+ return ($sw, $sh, 'GIF');
+ }
+ else
+ {
+ return (undef, undef,
+ "Invalid/Corrupted GIF (no Image Descriptors)");
+ }
}
$buf = &$read_in($stream, 1);
($x) = unpack("C", $buf);
@@ -651,10 +752,13 @@
return (undef, undef,
"Invalid/Corrupted GIF (missing image header?)");
}
- ($x, $w, $y, $h) = unpack("x4 C4", $buf);
- $x += $w * 256;
- $y += $h * 256;
- return ($x, $y, 'GIF');
+ ($x, $y) = unpack("x4 vv", $buf);
+ return ($x, $y, 'GIF') if ($Image::Size::GIF_BEHAVIOR == 1);
+ if ($x > $sw and $y > $sh)
+ {
+ $sw = $x;
+ $sh = $y;
+ }
}
if ($x == 0x21)
{
@@ -984,8 +1088,6 @@
my $image = shift;
my $header = &$read_in($image, 33);
- sub _bin2int { unpack("N", pack("B32", substr("0" x 32 . shift, -32))); }
-
my $ver = _bin2int(unpack 'B8', substr($header, 3, 1));
my $bs = unpack 'B133', substr($header, 8, 17);
my $bits = _bin2int(substr($bs, 0, 5));
@@ -1023,15 +1125,15 @@
my ($image) = @_;
my $header = &$read_in($image, 1058);
- sub _bin2int { unpack("N", pack("B32", substr("0" x 32 . shift, -32))); }
my $ver = _bin2int(unpack 'B8', substr($header, 3, 1));
- $header = substr($header, 8, 1024);
- $header = Compress::Zlib::uncompress($header);
+ my ($d, $status) = Compress::Zlib::inflateInit();
+ $header = $d->inflate(substr($header, 8, 1024));
+
my $bs = unpack 'B133', substr($header, 0, 9);
my $bits = _bin2int(substr($bs, 0, 5));
my $x = int(_bin2int(substr($bs, 5+$bits, $bits))/20);
my $y = int(_bin2int(substr($bs, 5+$bits*3, $bits))/20);
- return ($x, $y, 'SWC');
+ return ($x, $y, 'CWS');
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/imgsize new/Image-Size-3.0/imgsize
--- old/Image-Size-2.992/imgsize 2003-01-03 10:09:59.000000000 +0100
+++ new/Image-Size-3.0/imgsize 2006-05-25 11:07:46.000000000 +0200
@@ -42,6 +42,8 @@
other formatting directives will be lost. The numbers are passed as width
first, then height.
+=back
+
=head1 SEE ALSO
LImage::Size
Binary files old/Image-Size-2.992/t/468x60.psd and new/Image-Size-3.0/t/468x60.psd differ
Binary files old/Image-Size-2.992/t/8.swf and new/Image-Size-3.0/t/8.swf differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/t/all.t new/Image-Size-3.0/t/all.t
--- old/Image-Size-2.992/t/all.t 2001-09-19 05:20:29.000000000 +0200
+++ new/Image-Size-3.0/t/all.t 2006-06-10 08:35:56.000000000 +0200
@@ -1,60 +1,66 @@
-#!./perl
+#!/usr/bin/perl
use lib '../blib/lib';
+
use IO::File;
use Image::Size qw(:all);
+use Test::More tests => 17;
($dir = $0) =~ s/\w+\.t$//o;
-print "1..16\n";
-
#
-# Phase one, tests 1-10: basic types tested on files.
+# Phase one: basic types tested on files.
#
($x, $y) = imgsize("${dir}test.gif");
-print (($x == 60 && $y == 40) ? "ok 1\n" : "not ok 1\n");
+ok(($x == 60 && $y == 40), 'Basic GIF format test');
$html = html_imgsize("${dir}letter_T.jpg");
-print (($html =~ /width="52"\s+height="54"/oi) ? "ok 2\n" : "not ok 2\n");
+ok(($html =~ /width="52"\s+height="54"/oi),
+ 'Test html_imgsize and basic JPG format');
@attrs = attr_imgsize("${dir}xterm.xpm");
-print (($attrs[1] == 64 && $attrs[3] == 38) ? "ok 3\n" : "not ok 3\n");
+ok(($attrs[1] == 64 && $attrs[3] == 38),
+ 'Test attr_imgsize and basic XPM format');
($x, $y) = imgsize("${dir}spacer50.xbm");
-print (($x == 50 && $y == 10) ? "ok 4\n" : "not ok 4\n");
+ok(($x == 50 && $y == 10), 'Basic XBM format test');
($x, $y, $err) = imgsize("some non-existant file");
-print (($err =~ /can\'t open/oi) ? "ok 5\n" : "not ok 5\n");
+ok(($err =~ /can\'t open/oi), 'Test non-existent file error catching');
# The Pak-38 is actually a valid GIF, but this should work:
($x, $y) = imgsize("${dir}pak38.jpg");
-print (($x == 333 && $y == 194) ? "ok 6\n" : "not ok 6\n");
+ok(($x == 333 && $y == 194), 'Test format/file-extension mis-match');
# Test PNG image supplied by Tom Metro:
($x, $y) = imgsize("${dir}pass-1_s.png");
-print (($x == 90 && $y == 60) ? "ok 7\n" : "not ok 7\n");
+ok(($x == 90 && $y == 60), 'Basic PNG format test');
# Test PPM image code supplied by Carsten Dominik:
($x, $y, $id) = imgsize("${dir}letter_N.ppm");
-print (($x == 66 && $y == 57 && $id eq 'PPM') ? "ok 8\n" : "not ok 8\n");
+ok(($x == 66 && $y == 57 && $id eq 'PPM'), 'Basic PPM format test');
# Test TIFF image code supplied by Cloyce Spradling
($x, $y, $id) = imgsize("${dir}lexjdic.tif");
-print (($x == 35 && $y == 32 && $id eq 'TIF') ? "ok 9\n" : "not ok 9\n");
+ok(($x == 35 && $y == 32 && $id eq 'TIF'), 'Basic TIFF format test (1)');
($x, $y, $id) = imgsize("${dir}bexjdic.tif");
-print (($x == 35 && $y == 32 && $id eq 'TIF') ? "ok 10\n" : "not ok 10\n");
+ok(($x == 35 && $y == 32 && $id eq 'TIF'), 'Basic TIFF format test (2)');
# Test BMP code from Aldo Calpini
($x, $y, $id) = imgsize("${dir}xterm.bmp");
-print (($x == 64 && $y == 38 && $id eq 'BMP') ? "ok 11\n" : "not ok 11\n");
+ok(($x == 64 && $y == 38 && $id eq 'BMP'), 'Basic BMP format test');
# Test SWF code from Dmitry Dorofeev
($x, $y, $id) = imgsize("${dir}yasp.swf");
-print (($x == 85 && $y == 36 && $id eq 'SWF') ? "ok 12\n" : "not ok 12\n");
+ok(($x == 85 && $y == 36 && $id eq 'SWF'), 'Basic SWF format test');
+
+# Test CWS patch from mrj@mrj.spb.ru
+($x, $y, $id) = imgsize("${dir}8.swf");
+ok(($x == 280 && $y == 140 && $id eq 'CWS'), 'Basic CWS format test');
# Test the PSD code (orig. contributer unknown)
($x, $y, $id) = imgsize("${dir}468x60.psd");
-print (($x == 468 && $y == 60 && $id eq 'PSD') ? "ok 13\n" : "not ok 13\n");
+ok(($x == 468 && $y == 60 && $id eq 'PSD'), 'Basic PSD format test');
#
# Phase two: tests on in-memory strings.
@@ -64,14 +70,14 @@
read $fh, $data, (stat "${dir}test.gif")[7];
$fh->close;
($x, $y, $id) = imgsize(\$data);
-print (($x == 60 && $y == 40 && $id eq 'GIF') ? "ok 14\n" : "not ok 14\n");
+ok(($x == 60 && $y == 40 && $id eq 'GIF'), 'Test in-memory image data');
#
# Phase three: tests on open IO::File objects.
#
$fh = new IO::File "< ${dir}test.gif";
($x, $y, $id) = imgsize($fh);
-print (($x == 60 && $y == 40 && $id eq 'GIF') ? "ok 15\n" : "not ok 15\n");
+ok(($x == 60 && $y == 40 && $id eq 'GIF'), 'Test open IO::File object');
# Reset to head
$fh->seek(0, 0);
@@ -79,8 +85,8 @@
$fh->seek(128, 0);
# Do it again. This time when we check results, $fh->tell should be 128
($x, $y, $id) = imgsize($fh);
-print STDOUT (($x == 60 && $y == 40 && $id eq 'GIF' && ($fh->tell == 128)) ?
- "ok 16\n" : "not ok 16\n");
+ok(($x == 60 && $y == 40 && $id eq 'GIF' && ($fh->tell == 128)),
+ 'Test that it leaves open IO::File object in the same position');
$fh->close;
Binary files old/Image-Size-2.992/t/letter_N.ppm and new/Image-Size-3.0/t/letter_N.ppm differ
Binary files old/Image-Size-2.992/t/letter_T.jpg and new/Image-Size-3.0/t/letter_T.jpg differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/t/magick.t new/Image-Size-3.0/t/magick.t
--- old/Image-Size-2.992/t/magick.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Image-Size-3.0/t/magick.t 2006-06-10 08:11:43.000000000 +0200
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+
+# Tests related to Image::Magick and Graphics::Magick
+
+BEGIN: {
+ use Test::More tests => 2;
+ use_ok('Image::Size');
+}
+
+# This test should work whether or not Image::Magick is installed.
+ok(!(exists $INC{'Image/Magick.pm'}),
+ 'Image::Magick should not be loaded until it is needed if it available')
+ || diag "Image::Magick loaded at: $INC{'Image/Magick.pm'}";
Binary files old/Image-Size-2.992/t/pak38.jpg and new/Image-Size-3.0/t/pak38.jpg differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/t/pod.t new/Image-Size-3.0/t/pod.t
--- old/Image-Size-2.992/t/pod.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Image-Size-3.0/t/pod.t 2006-05-25 11:17:00.000000000 +0200
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+use Test::More;
+
+eval "use Test::Pod 1.00";
+
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+
+all_pod_files_ok();
+
+exit;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Image-Size-2.992/t/pod_coverage.t new/Image-Size-3.0/t/pod_coverage.t
--- old/Image-Size-2.992/t/pod_coverage.t 1970-01-01 01:00:00.000000000 +0100
+++ new/Image-Size-3.0/t/pod_coverage.t 2006-05-25 11:16:52.000000000 +0200
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.00";
+
+plan skip_all =>
+ "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
+plan tests => 1;
+
+pod_coverage_ok(Image::Size => { also_private => [ qr/size$/, 'img_eof' ] },
+ 'Image::Size');
+
+exit;
Binary files old/Image-Size-2.992/t/test.gif and new/Image-Size-3.0/t/test.gif differ
Binary files old/Image-Size-2.992/t/yasp.swf and new/Image-Size-3.0/t/yasp.swf differ
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit-help@opensuse.org