Hello community, here is the log from the commit of package perl-Image-Size for openSUSE:Factory checked in at 2015-04-16 14:14:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Image-Size (Old) and /work/SRC/openSUSE:Factory/.perl-Image-Size.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Image-Size" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Image-Size/perl-Image-Size.changes 2013-06-13 17:39:41.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Image-Size.new/perl-Image-Size.changes 2015-04-16 14:14:20.000000000 +0200 @@ -1,0 +2,50 @@ +Tue Apr 14 20:17:04 UTC 2015 - [email protected] + +- updated to 3.300 + see /usr/share/doc/packages/perl-Image-Size/ChangeLog + + 3.300 Saturday February 28, 2015, 08:44:22 AM -0800 + + * lib/Image/Size.pm + * t/all.t + * t/old-os2.bmp (added) + Add support for old OS/2 version of BMP header (Geoff Richards). + + * lib/Image/Size.pm + Typo fixes (David Steinbrunner). + + * lib/Image/Size.pm + Avoid a sprintf() warning in Perl 5.21. Perl 5.21 introduces a + warning for redundant arguments to s?printf(), so sprintf("%d", + 1, 2) would warn. This commit silences that warning by passing + sprintf the exact number of arguments that it expects (Brian + Fraser). + + * lib/Image/Size.pm + Added =encoding utf8 to pod - the accented character was + causing a pod error (Neil Bowers). + + * lib/Image/Size.pm + Added Z<> to the =item [012] to resolve pod warning. You can't + have =item 0, so the way round this seems to be to add a Z<> + (zero width space) before each digit (Neil Bowers). + + * lib/Image/Size.pm + Added link to github repo to doc (Neil Bowers). + + * lib/Image/Size.pm + RT #41238: Applied modified version of patch from user to fix a + die problem with unpack on truncated files. + + * lib/Image/Size.pm + * t/1.sm.webp (added) + * t/all.t + * t/move.cur (added) + * t/tux.ico (added) + Add support for WEBP, ICO and CUR file types (Baldur + Kristinsson). + + * lib/Image/Size.pm + Fix some perlcritic issues. + +------------------------------------------------------------------- Old: ---- Image-Size-3.232.tar.gz New: ---- Image-Size-3.300.tar.gz cpanspec.yml ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Image-Size.spec ++++++ --- /var/tmp/diff_new_pack.6demMr/_old 2015-04-16 14:14:20.000000000 +0200 +++ /var/tmp/diff_new_pack.6demMr/_new 2015-04-16 14:14:20.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Image-Size # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,23 +17,22 @@ Name: perl-Image-Size -Version: 3.232 +Version: 3.300 Release: 0 +#Upstream: Artistic-1.0 or GPL-1.0+ %define cpan_name Image-Size -Summary: Read the dimensions of an image in several popular formats +Summary: Read the Dimensions of an Image in Several Popular Formats License: LGPL-2.1 or Artistic-1.0 Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Image-Size/ -Source: http://www.cpan.org/authors/id/R/RJ/RJRAY/%{cpan_name}-%{version}.tar.gz -# MANUAL LICENSE +Source0: http://www.cpan.org/authors/id/R/RJ/RJRAY/%{cpan_name}-%{version}.tar.gz +Source1: cpanspec.yml BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros -BuildRequires: perl(Module::Build) >= 0.4 +BuildRequires: perl(Module::Build) >= 0.42 BuildRequires: perl(Test::More) >= 0.80 -#BuildRequires: perl(Compress::Zlib) -#BuildRequires: perl(Image::Size) Requires: perl(Module::Build) >= 0.28 Requires: perl(Test::More) >= 0.80 Recommends: perl(Compress::Zlib) >= 2 @@ -64,6 +63,6 @@ %files -f %{name}.files %defattr(-,root,root,755) -%doc ChangeLog ChangeLog.xml etc ex imgsize README README.textile xt +%doc ChangeLog ChangeLog.xml etc ex imgsize README README.textile %changelog ++++++ Image-Size-3.232.tar.gz -> Image-Size-3.300.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/ChangeLog new/Image-Size-3.300/ChangeLog --- old/Image-Size-3.232/ChangeLog 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/ChangeLog 2015-02-28 18:00:55.000000000 +0100 @@ -5,6 +5,50 @@ in a wide variety of common (and not-so-common) formats. +3.300 Saturday February 28, 2015, 08:44:22 AM -0800 + + * lib/Image/Size.pm + * t/all.t + * t/old-os2.bmp (added) + Add support for old OS/2 version of BMP header (Geoff Richards). + + * lib/Image/Size.pm + Typo fixes (David Steinbrunner). + + * lib/Image/Size.pm + Avoid a sprintf() warning in Perl 5.21. Perl 5.21 introduces a + warning for redundant arguments to s?printf(), so sprintf("%d", + 1, 2) would warn. This commit silences that warning by passing + sprintf the exact number of arguments that it expects (Brian + Fraser). + + * lib/Image/Size.pm + Added =encoding utf8 to pod - the accented character was + causing a pod error (Neil Bowers). + + * lib/Image/Size.pm + Added Z<> to the =item [012] to resolve pod warning. You can't + have =item 0, so the way round this seems to be to add a Z<> + (zero width space) before each digit (Neil Bowers). + + * lib/Image/Size.pm + Added link to github repo to doc (Neil Bowers). + + * lib/Image/Size.pm + RT #41238: Applied modified version of patch from user to fix a + die problem with unpack on truncated files. + + * lib/Image/Size.pm + * t/1.sm.webp (added) + * t/all.t + * t/move.cur (added) + * t/tux.ico (added) + Add support for WEBP, ICO and CUR file types (Baldur + Kristinsson). + + * lib/Image/Size.pm + Fix some perlcritic issues. + 3.232 Monday May 28, 2012, 05:20:00 PM -0700 * lib/Image/Size.pm @@ -575,9 +619,9 @@ * t/all.t (added) Initial commit of the core project files. -# Generated on Monday May 28, 2012, 05:23:22 PM -0700 -# Using changelog2x/0.11, App::Changelog2x/0.11, XML::LibXML/1.96, -# XML::LibXSLT/1.77, libxml/2.7.3, libxslt/1.1.24 (with exslt) +# Generated on Saturday February 28, 2015, 09:00:55 AM -0800 +# Using changelog2x/0.11, App::Changelog2x/0.11, XML::LibXML/2.0117, +# XML::LibXSLT/1.92, libxml/2.9.0, libxslt/1.1.28 (with exslt) # XSLT sources: # $Id: changelog2text.xslt 8 2009-01-19 06:46:50Z rjray $ # $Id: common-text.xslt 8 2009-01-19 06:46:50Z rjray $ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/ChangeLog.xml new/Image-Size-3.300/ChangeLog.xml --- old/Image-Size-3.232/ChangeLog.xml 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/ChangeLog.xml 2015-02-28 18:00:55.000000000 +0100 @@ -13,6 +13,80 @@ information from files in a wide variety of common (and not-so-common) formats. </description> + <release version="3.300" sc:tag="3.300" date="2015-02-28T08:44:22-08:00"> + <change git:commit="f538442f7b6a0547142337be988c96b8d37648c0"> + <fileset> + <file path="lib/Image/Size.pm" /> + <file path="t/all.t" /> + <file path="t/old-os2.bmp" action="ADD" /> + </fileset> + <description> + Add support for old OS/2 version of BMP header (Geoff Richards). + </description> + </change> + <change git:commit="d5a47fa98f5008a419de60a826883cdfa1bad4f8"> + <file path="lib/Image/Size.pm" /> + <description> + Typo fixes (David Steinbrunner). + </description> + </change> + <change git:commit="28fb705be3730342cb65fe5e1fde252fa4424ca6"> + <file path="lib/Image/Size.pm" /> + <description> + Avoid a sprintf() warning in Perl 5.21. Perl 5.21 introduces a warning + for redundant arguments to s?printf(), so sprintf("%d", 1, 2) would + warn. This commit silences that warning by passing sprintf the + exact number of arguments that it expects (Brian Fraser). + </description> + </change> + <change git:commit="64e39193169d32f4a2d366f11d1eb97a9695fc9d"> + <file path="lib/Image/Size.pm" /> + <description> + Added =encoding utf8 to pod - the accented character was causing a pod + error (Neil Bowers). + </description> + </change> + <change git:commit="d8e79be2f5a5844c63829ff4598047e71eb40cf5"> + <file path="lib/Image/Size.pm" /> + <description> + Added Z<> to the =item [012] to resolve pod warning. + You can't have =item 0, so the way round this seems to be to add a + Z<> (zero width space) before each digit (Neil Bowers). + </description> + </change> + <change git:commit="5f7f014873171be7c0bb3f942d25587c2e312a47"> + <file path="lib/Image/Size.pm" /> + <description> + Added link to github repo to doc (Neil Bowers). + </description> + </change> + <change git:commit="ecf88247cbb9122e1cd290e559031dc911bad09f"> + <file path="lib/Image/Size.pm" /> + <description> + <xhtml:a href="http://rt.cpan.org/Ticket/Display.html?id=41238">RT #41238</xhtml:a>: + Applied modified version of patch from user to fix a die problem with + unpack on truncated files. + </description> + </change> + <change git:commit="7f3de1e5f29d84d45a8ad98a76b7cbbe9112667c"> + <fileset> + <file path="lib/Image/Size.pm" /> + <file path="t/1.sm.webp" action="ADD" /> + <file path="t/all.t" /> + <file path="t/move.cur" action="ADD" /> + <file path="t/tux.ico" action="ADD" /> + </fileset> + <description> + Add support for WEBP, ICO and CUR file types (Baldur Kristinsson). + </description> + </change> + <change git:commit="cd5a4a70d4a8ca500bf31fd7aa6ae504eba70891"> + <file path="lib/Image/Size.pm" /> + <description> + Fix some perlcritic issues. + </description> + </change> + </release> <release version="3.232" sc:tag="3.232" date="2012-05-28T17:20:00-07:00"> <change git:commit="330406f70b677b6ed71309d49c381b61738328b0"> <file path="lib/Image/Size.pm" /> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/MANIFEST new/Image-Size-3.300/MANIFEST --- old/Image-Size-3.232/MANIFEST 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/MANIFEST 2015-02-28 18:00:55.000000000 +0100 @@ -8,6 +8,7 @@ MANIFEST.SKIP README README.textile +t/1.sm.webp t/468x60.psd t/8.swf t/all.t @@ -17,11 +18,14 @@ t/letter_T.jpg t/lexjdic.tif t/magick.t +t/move.cur +t/old-os2.bmp t/pak38.jpg t/pass-1_s.png t/spacer50.xbm t/test.gif t/Test_emf_small.emf +t/tux.ico t/xterm.bmp t/xterm.xpm t/yasp.swf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/META.json new/Image-Size-3.300/META.json --- old/Image-Size-3.232/META.json 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/META.json 2015-02-28 18:00:55.000000000 +0100 @@ -4,7 +4,7 @@ "Randy J. Ray <[email protected]>" ], "dynamic_config" : 1, - "generated_by" : "Module::Build version 0.4, CPAN::Meta::Converter version 2.120921", + "generated_by" : "Module::Build version 0.421", "license" : [ "perl_5" ], @@ -22,7 +22,7 @@ }, "configure" : { "requires" : { - "Module::Build" : "0.4" + "Module::Build" : "0.42" } }, "runtime" : { @@ -38,7 +38,7 @@ "provides" : { "Image::Size" : { "file" : "lib/Image/Size.pm", - "version" : "3.232" + "version" : "3.300" } }, "release_status" : "stable", @@ -54,5 +54,5 @@ "url" : "http://github.com/rjray/image-size" } }, - "version" : "3.232" + "version" : "3.300" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/META.yml new/Image-Size-3.300/META.yml --- old/Image-Size-3.232/META.yml 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/META.yml 2015-02-28 18:00:55.000000000 +0100 @@ -3,29 +3,29 @@ author: - 'Randy J. Ray <[email protected]>' build_requires: - Module::Build: 0.28 - Test::More: 0.80 + Module::Build: '0.28' + Test::More: '0.80' configure_requires: - Module::Build: 0.4 + Module::Build: '0.42' dynamic_config: 1 -generated_by: 'Module::Build version 0.4, CPAN::Meta::Converter version 2.120921' +generated_by: 'Module::Build version 0.421, CPAN::Meta::Converter version 2.143240' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + version: '1.4' name: Image-Size provides: Image::Size: file: lib/Image/Size.pm - version: 3.232 + version: '3.300' recommends: - Compress::Zlib: 2 + Compress::Zlib: '2' requires: - File::Spec: 0.8 - perl: 5.006001 + File::Spec: '0.8' + perl: '5.006001' resources: bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Image-Size homepage: http://search.cpan.org/dist/Image-Size license: http://dev.perl.org/licenses/ repository: http://github.com/rjray/image-size -version: 3.232 +version: '3.300' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/Makefile.PL new/Image-Size-3.300/Makefile.PL --- old/Image-Size-3.232/Makefile.PL 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/Makefile.PL 2015-02-28 18:00:55.000000000 +0100 @@ -1,19 +1,19 @@ -# Note: this file was auto-generated by Module::Build::Compat version 0.40 +# Note: this file was auto-generated by Module::Build::Compat version 0.4210 require 5.006001; use ExtUtils::MakeMaker; WriteMakefile ( - 'PL_FILES' => {}, - 'INSTALLDIRS' => 'site', 'NAME' => 'Image::Size', - 'EXE_FILES' => [ - 'imgsize' - ], 'VERSION_FROM' => 'lib/Image/Size.pm', 'PREREQ_PM' => { - 'Test::More' => '0.80', 'File::Spec' => '0.8', - 'Module::Build' => '0.28' - } + 'Module::Build' => '0.28', + 'Test::More' => '0.80' + }, + 'INSTALLDIRS' => 'site', + 'EXE_FILES' => [ + 'imgsize' + ], + 'PL_FILES' => {} ) ; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/README new/Image-Size-3.300/README --- old/Image-Size-3.232/README 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/README 2015-02-28 18:00:55.000000000 +0100 @@ -1,7 +1,7 @@ Image::Size - Determine the size of images in several common formats ==================================================================== -Version: 3.232 (See CHANGES below) +Version: 3.300 (See CHANGES below) WHAT IS IT @@ -80,5 +80,55 @@ * lib/Image/Size.pm -Removed the "!" flag in pack template for EMF. It was not needed and it broke on -earlier Perls. + * t/all.t + + * t/old-os2.bmp (added) + +Add support for old OS/2 version of BMP header (Geoff Richards). + + * lib/Image/Size.pm + +Typo fixes (David Steinbrunner). + + * lib/Image/Size.pm + +Avoid a sprintf() warning in Perl 5.21. Perl 5.21 introduces a warning for +redundant arguments to s?printf(), so sprintf("%d", 1, 2) would warn. This +commit silences that warning by passing sprintf the exact number of arguments +that it expects (Brian Fraser). + + * lib/Image/Size.pm + +Added =encoding utf8 to pod - the accented character was causing a pod error +(Neil Bowers). + + * lib/Image/Size.pm + +Added Z<> to the =item [012] to resolve pod warning. You can't have =item 0, so +the way round this seems to be to add a Z<> (zero width space) before each digit +(Neil Bowers). + + * lib/Image/Size.pm + +Added link to github repo to doc (Neil Bowers). + + * lib/Image/Size.pm + +RT #41238: Applied modified version of patch from user to fix a die problem with +unpack on truncated files. + + * lib/Image/Size.pm + + * t/1.sm.webp (added) + + * t/all.t + + * t/move.cur (added) + + * t/tux.ico (added) + +Add support for WEBP, ICO and CUR file types (Baldur Kristinsson). + + * lib/Image/Size.pm + +Fix some perlcritic issues. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/README.textile new/Image-Size-3.300/README.textile --- old/Image-Size-3.232/README.textile 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/README.textile 2015-02-28 18:00:55.000000000 +0100 @@ -1,6 +1,6 @@ h1. Image::Size - Determine the size of images in several common formats -Version: 3.232 (See CHANGES below) +Version: 3.300 (See CHANGES below) h2. WHAT IS IT @@ -70,5 +70,43 @@ h2. CHANGES * lib/Image/Size.pm +* t/all.t +* t/old-os2.bmp (added) -p{margin-bottom:2em}. Removed the "!" flag in pack template for EMF. It was not needed and it broke on earlier Perls. +p{margin-bottom:2em}. Add support for old OS/2 version of BMP header (Geoff Richards). + +* lib/Image/Size.pm + +p{margin-bottom:2em}. Typo fixes (David Steinbrunner). + +* lib/Image/Size.pm + +p{margin-bottom:2em}. Avoid a sprintf() warning in Perl 5.21. Perl 5.21 introduces a warning for redundant arguments to s?printf(), so sprintf("%d", 1, 2) would warn. This commit silences that warning by passing sprintf the exact number of arguments that it expects (Brian Fraser). + +* lib/Image/Size.pm + +p{margin-bottom:2em}. Added =encoding utf8 to pod - the accented character was causing a pod error (Neil Bowers). + +* lib/Image/Size.pm + +p{margin-bottom:2em}. Added Z<> to the =item [012] to resolve pod warning. You can't have =item 0, so the way round this seems to be to add a Z<> (zero width space) before each digit (Neil Bowers). + +* lib/Image/Size.pm + +p{margin-bottom:2em}. Added link to github repo to doc (Neil Bowers). + +* lib/Image/Size.pm + +p{margin-bottom:2em}. RT #41238: Applied modified version of patch from user to fix a die problem with unpack on truncated files. + +* lib/Image/Size.pm +* t/1.sm.webp (added) +* t/all.t +* t/move.cur (added) +* t/tux.ico (added) + +p{margin-bottom:2em}. Add support for WEBP, ICO and CUR file types (Baldur Kristinsson). + +* lib/Image/Size.pm + +p{margin-bottom:2em}. Fix some perlcritic issues. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/lib/Image/Size.pm new/Image-Size-3.300/lib/Image/Size.pm --- old/Image-Size-3.232/lib/Image/Size.pm 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/lib/Image/Size.pm 2015-02-28 18:00:55.000000000 +0100 @@ -1,6 +1,6 @@ ############################################################################### # -# This file copyright (c) 2012 by Randy J. Ray, all rights reserved +# This file copyright (c) 2015 by Randy J. Ray, all rights reserved # # Copying and distribution are permitted under the terms of the Artistic # License 2.0 (http://www.opensource.org/licenses/artistic-license-2.0.php) or @@ -23,27 +23,25 @@ # These are the Perl::Critic policies that are being turned off globally: ## no critic(RequireBriefOpen) ## no critic(ProhibitAutomaticExportation) -## no critic(ProhibitExplicitISA) use strict; use warnings; use bytes; use vars qw( - @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION $NO_CACHE %CACHE + @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION $NO_CACHE %CACHE $GIF_BEHAVIOR @TYPE_MAP %PCD_MAP $PCD_SCALE $READ_IN $LAST_POS ); -use Exporter; +use Exporter 'import'; BEGIN { - @ISA = qw(Exporter); @EXPORT = qw(imgsize); @EXPORT_OK = qw(imgsize html_imgsize attr_imgsize %CACHE $NO_CACHE $PCD_SCALE $GIF_BEHAVIOR); %EXPORT_TAGS = ('all' => [ @EXPORT_OK ]); - $VERSION = '3.232'; + $VERSION = '3.300'; $VERSION = eval $VERSION; ## no critic(ProhibitStringyEval) # Default behavior for GIFs is to return the "screen" size @@ -72,6 +70,9 @@ qr{^CWS} => \&swfmxsize, qr{^\x8aMNG\x0d\x0a\x1a\x0a} => \&mngsize, qr{^\x01\x00\x00\x00} => \&emfsize, + qr{^RIFF(?s:....)WEBP} => \&webpsize, + qr{^\x00\x00\x01\x00} => \&icosize, + qr{^\x00\x00\x02\x00} => \&cursize, ); # Kodak photo-CDs are weird. Don't ask me why, you really don't want details. %PCD_MAP = ( 'base/16' => [ 192, 128 ], @@ -131,7 +132,7 @@ my ($handle, $header); my ($x, $y, $id, $mtime, @list); - # These only used if $stream is an existant open FH + # These only used if $stream is an existing open FH my ($save_pos, $need_restore) = (0, 0); # This is for when $stream is a locally-opened file my $need_close = 0; @@ -156,7 +157,7 @@ $save_pos = tell $handle; $need_restore = 1; - # First alteration (didn't wait long, did I?) to the existant handle: + # First alteration (didn't wait long, did I?) to the existing handle: # # assist dain-bramaged operating systems -- SWD # SWD: I'm a bit uncomfortable with changing the mode on a file @@ -234,7 +235,7 @@ $CACHE{$stream} = join q{,}, $mtime, $x, $y, $id; } - # If we were passed an existant file handle, we need to restore the + # If we were passed an existing file handle, we need to restore the # old filepos: if ($need_restore) { @@ -325,7 +326,7 @@ # Use lowercase and quotes so that it works with xhtml. return ((defined $args[0]) ? - sprintf('width="%d" height="%d"', @args) : + sprintf('width="%d" height="%d"', @args[0,1]) : undef); } @@ -365,13 +366,10 @@ ########################################################################### # Subroutine gets the size of the specified GIF ########################################################################### -sub gifsize +sub gifsize ## no critic(ProhibitExcessComplexity) { my $stream = shift; - # We use bitwise-and here: - ## no critic(ProhibitBitwiseOperators) - my ($cmapsize, $buf, $sh, $sw, $x, $y, $type); my $gif_blockskip = sub { @@ -641,7 +639,11 @@ elsif ((ord($code) >= $SIZE_FIRST) && (ord($code) <= $SIZE_LAST)) { # Segments that contain size info - ($y, $x) = unpack 'xnn', $READ_IN->($stream, 5); + $length = 5; + my $buf = $READ_IN->($stream, $length); + # unpack dies on truncated data + last if (length($buf) < $length); + ($y, $x) = unpack 'xnn', $buf; $id = 'JPG'; last; } @@ -792,7 +794,15 @@ my $buffer; $buffer = $READ_IN->($stream, 26); - ($x, $y) = unpack 'x18VV', $buffer; + my $header_size = unpack 'x14V', $buffer; + if ($header_size == 12) + { + ($x, $y) = unpack 'x18vv', $buffer; # old OS/2 header + } + else + { + ($x, $y) = unpack 'x18VV', $buffer; # modern Windows header + } if (defined $x and defined $y) { $id = 'BMP'; @@ -842,9 +852,6 @@ { my $stream = shift; - # We use bitwise-and here: - ## no critic(ProhibitBitwiseOperators) - my ($x, $y, $id) = (undef, undef, 'Unable to determine size of PCD data'); my $buffer = $READ_IN->($stream, 0xf00); @@ -911,10 +918,65 @@ return ($x, $y, 'EMF'); } +# WEBP files, see https://developers.google.com/speed/webp/docs/riff_container +# Added by Baldur Kristinsson, github.com/bk +sub webpsize { + my $img = shift; + + # There are 26 bytes of lead-in, before the width and height info: + # 1. WEBP container + # - 'RIFF', 4 bytes + # - filesize, 4 bytes + # - 'WEBP', 4 bytes + # 2. VP8 frame + # - 'VP8', 3 bytes + # - frame meta, 8 bytes + # - marker, 3 bytes + my $buf = $READ_IN->($img, 4, 26); + my ($raw_w, $raw_h) = unpack 'SS', $buf; + my $b14 = 2**14 - 1; + + # The width and height values contain a 2-bit scaling factor, + # which is left-shifted by 14 bits. We ignore this, since it seems + # not to be relevant for our purposes. WEBP images in actual use + # all seem to have a scaling factor of 0, anyway. (The meaning + # of the scaling factor is as follows: 0=no upscale, 1=upscale by 5/4, + # 2=upscale by 5/3, 3=upscale by 2). + # + # my $wscale = $raw_w >> 14; + # my $hscale = $raw_h >> 14; + my $x = $raw_w & $b14; + my $y = $raw_h & $b14; + + return ($x, $y, 'WEBP'); +} + +# ICO files, originally contributed by Thomas Walloschke <[email protected]>, +# see https://rt.cpan.org/Public/Bug/Display.html?id=46279 +# (revised by Baldur Kristinsson, github.com/bk) +sub icosize { + my $img = shift; + my ($x, $y) = unpack 'CC', $READ_IN->($img, 2, 6); + if ($x == 0) { $x = 256; } + if ($y == 0) { $y = 256; } + return ($x, $y, 'ICO'); +} + +# CUR files, originally contributed by Thomas Walloschke <[email protected]>, +# see https://rt.cpan.org/Public/Bug/Display.html?id=46279 +# (revised by Baldur Kristinsson, github.com/bk) +sub cursize { + my ($x, $y, $ico) = icosize(shift); + return ($x, $y, 'CUR'); +} + + 1; __END__ +=encoding utf8 + =head1 NAME Image::Size - read the dimensions of an image in several popular formats @@ -1057,6 +1119,12 @@ =item EMF (Windows Enhanced Metafile Format) +=item WEBP + +=item ICO (Microsoft icon format) + +=item CUR (Microsoft mouse cursor format) + =back Additionally, if the B<Image::Magick> module is present, the file types @@ -1075,7 +1143,7 @@ abbreviation format. For example, a WBMP file might be reported as 'Wireless Bitmap (level 0) image' in this case. -=head2 Information Cacheing and C<$NO_CACHE> +=head2 Information Caching and C<$NO_CACHE> When a filename is passed to any of the sizing routines, the default behavior of the library is to cache the resulting information. The modification-time of @@ -1084,7 +1152,7 @@ applications were using this library to generate attributes for pages that often used the same graphical element many times over. -However, the cacheing can lead to problems when the files are generated +However, the caching can lead to problems when the files are generated dynamically, at a rate that exceeds the resolution of the modification-time value on the filesystem. Thus, the optionally-importable control variable C<$NO_CACHE> has been introduced. If this value is anything that evaluates to a @@ -1158,7 +1226,7 @@ =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 +Because GIFs can be a series of sub-images to be played 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 @@ -1168,7 +1236,7 @@ =over 4 -=item 0 +=item Z<>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 @@ -1179,7 +1247,7 @@ This is also the fastest method for sizing the GIF, as it reads the least amount of data from the image stream. -=item 1 +=item Z<>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 @@ -1188,7 +1256,7 @@ When the first image descriptor block is read, the code immediately returns, making this only slightly-less efficient than the previous setting. -=item 2 +=item Z<>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. @@ -1297,7 +1365,7 @@ =head1 DIAGNOSTICS The base routine, C<imgsize>, returns B<undef> as the first value in its list -when an error has occured. The third element contains a descriptive +when an error has occurred. The third element contains a descriptive error message. The other two routines simply return B<undef> in the case of error. @@ -1308,7 +1376,7 @@ file handles and scalar references cannot be reliably transformed into a unique key for the table of cache data. Buffers could be cached using the MD5 module, and perhaps in the future I will make that an option. I do not, -however, wish to lengthen the dependancy list by another item at this time. +however, wish to lengthen the dependency list by another item at this time. As B<Image::Magick> operates on file names, not handles, the use of it is restricted to cases where the input to C<imgsize> is provided as file name. @@ -1342,7 +1410,7 @@ was adapted from a script made available by Phil Greenspun, as guided to my attention by Matt Mueller I<[email protected]>. A thorough read of the documentation and source by Philip Newton I<[email protected]> -found several typos and a small buglet. Ville Skytt� I<([email protected])> +found several typos and a small buglet. Ville Skytt� I<([email protected])> provided the MNG and the Image::Magick fallback code. Craig MacKenna I<([email protected])> suggested making the cache available so that it could be used with shared memory, and helped test my change before release. @@ -1381,6 +1449,10 @@ =back +=head1 REPOSITORY + +L<https://github.com/rjray/image-size> + =head1 LICENSE AND COPYRIGHT This file and the code within are copyright (c) 1996-2009 by Randy J. Ray. Files old/Image-Size-3.232/t/1.sm.webp and new/Image-Size-3.300/t/1.sm.webp differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Image-Size-3.232/t/all.t new/Image-Size-3.300/t/all.t --- old/Image-Size-3.232/t/all.t 2012-05-29 02:23:23.000000000 +0200 +++ new/Image-Size-3.300/t/all.t 2015-02-28 18:00:55.000000000 +0100 @@ -2,7 +2,7 @@ use IO::File; use Image::Size qw(:all); -use Test::More tests => 19; +use Test::More tests => 23; # We now only test the CWS branch if the user already has Compress::Zlib # available. We no longer require it for installation. @@ -52,6 +52,8 @@ # Test BMP code from Aldo Calpini ($x, $y, $id) = imgsize("${dir}xterm.bmp"); ok(($x == 64 && $y == 38 && $id eq 'BMP'), 'Basic BMP format test'); +($x, $y, $id) = imgsize("${dir}old-os2.bmp"); +ok(($x == 1500 && $y == 1000 && $id eq 'BMP'), 'Basic BMP OS/2 format test'); # Test SWF code from Dmitry Dorofeev <[email protected]> ($x, $y, $id) = imgsize("${dir}yasp.swf"); @@ -61,6 +63,18 @@ ($x, $y, $id) = imgsize("${dir}Test_emf_small.emf"); ok(($x == 638 && $y == 949 && $id eq 'EMF'), 'Basic EMF format test'); +# Test WEBP code from Baldur Kristinsson +($x, $y, $id) = imgsize("${dir}1.sm.webp"); +ok(($x == 320 && $y == 214 && $id eq 'WEBP'), 'Basic WEBP format test'); + +# Test ICO code from Baldur Kristinsson +($x, $y, $id) = imgsize("${dir}tux.ico"); +ok(($x == 16 && $y == 16 && $id eq 'ICO'), 'Basic ICO format test'); + +# Test CUR code from Baldur Kristinsson +($x, $y, $id) = imgsize("${dir}move.cur"); +ok(($x == 32 && $y == 32 && $id eq 'CUR'), 'Basic CUR format test'); + SKIP: { skip 'Compress::Zlib not installed', 1 unless $do_cws_test; Files old/Image-Size-3.232/t/move.cur and new/Image-Size-3.300/t/move.cur differ Files old/Image-Size-3.232/t/old-os2.bmp and new/Image-Size-3.300/t/old-os2.bmp differ Files old/Image-Size-3.232/t/tux.ico and new/Image-Size-3.300/t/tux.ico differ ++++++ cpanspec.yml ++++++ --- #description_paragraphs: 3 #no_testing: broken upstream #sources: # - source1 # - source2 #patches: # foo.patch: -p1 # bar.patch: #preamble: |- # BuildRequires: gcc-c++ #post_prep: |- # hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'` # sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL #post_install: |- # sed on %{name}.files license: LGPL-2.1 or Artistic-1.0 #skip_noarch: 1 #custom_build: - #./Build build flags=%{?_smp_mflags} --myflag
