r28171 - in /trunk/libimager-perl: ./ ICO/ ICO/t/ ICO/testimg/ debian/ lib/Imager/ lib/Imager/Font/ t/

rmayorga-guest at users.alioth.debian.org rmayorga-guest at users.alioth.debian.org
Sat Dec 13 02:24:09 UTC 2008


Author: rmayorga-guest
Date: Sat Dec 13 02:24:06 2008
New Revision: 28171

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28171
Log:
* New upstream release
* debian/control
  + use debhelper version 7
  + Set standards-version to 3.8.0
  + add myself to uploaders
* debian/copyright updated using dh-make-perl.
  Add debian/* copyright stanza based on the
  names from changelog
* debian/rules updated using dh-make-perl

Added:
    trunk/libimager-perl/ICO/testimg/rgb1616.ico
      - copied unchanged from r28153, branches/upstream/libimager-perl/current/ICO/testimg/rgb1616.ico
    trunk/libimager-perl/debian/libimager-perl.docs
    trunk/libimager-perl/debian/libimager-perl.examples
    trunk/libimager-perl/t/t83extutil.t
      - copied unchanged from r28153, branches/upstream/libimager-perl/current/t/t83extutil.t
Modified:
    trunk/libimager-perl/Changes
    trunk/libimager-perl/ICO/imicon.c
    trunk/libimager-perl/ICO/msicon.c
    trunk/libimager-perl/ICO/t/t10icon.t
    trunk/libimager-perl/Imager.pm
    trunk/libimager-perl/Imager.xs
    trunk/libimager-perl/MANIFEST
    trunk/libimager-perl/META.yml
    trunk/libimager-perl/bmp.c
    trunk/libimager-perl/debian/changelog
    trunk/libimager-perl/debian/compat
    trunk/libimager-perl/debian/control
    trunk/libimager-perl/debian/copyright
    trunk/libimager-perl/debian/rules
    trunk/libimager-perl/lib/Imager/ExtUtils.pm
    trunk/libimager-perl/lib/Imager/Files.pod
    trunk/libimager-perl/lib/Imager/Font/BBox.pm
    trunk/libimager-perl/lib/Imager/ImageTypes.pod
    trunk/libimager-perl/rubthru.im
    trunk/libimager-perl/t/t023palette.t
    trunk/libimager-perl/t/t105gif.t
    trunk/libimager-perl/t/t107bmp.t

Modified: trunk/libimager-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/Changes?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/Changes (original)
+++ trunk/libimager-perl/Changes Sat Dec 13 02:24:06 2008
@@ -1,6 +1,46 @@
 Imager release history.  Older releases can be found in Changes.old
 
-Imager 0.65 - unreleased
+Imager 0.67 - 12 Dec 2008
+===========
+
+Bug fixes:
+
+ - fix a packaging error
+
+Imager 0.66 - 12 Dec 2008
+===========
+
+ - 24-bit color .ICO/.CUR files can now be read.
+
+Bug fixes:
+
+ - an optimization skipping 0 src alpha values could cause the
+   rubthrough() to read past the end of a buffer.
+   http://www.nntp.perl.org/group/perl.cpan.testers/2008/05/msg1509184.html
+
+ - corrected a reference leak where writing GIFs would leak memory.
+   This could also happen calling to_paletted().
+   Also documented the underlying long existing feature where the
+   colors parameter is filled with the generated color table and added
+   tests for it.
+   http://rt.cpan.org/Ticket/Display.html?id=41028
+
+ - write out the image size in bytes field of a BMP correctly.
+   http://rt.cpan.org/Ticket/Display.html?id=41406
+
+ - add limited tests for Imager::ExtUtils
+
+ - make Imager::ExtUtils->includes use an absolute path, since
+   a relative path could cause failures using Inline::C.
+   http://rt.cpan.org/Ticket/Display.html?id=37353
+
+ - re-arrange the POD for Imager::Font::BBox:
+   - mark total_width(), pos_width(), end_offset() obsolete, since
+     they're mostly for backwards compatibility
+   - group width methods and height methods
+   https://rt.cpan.org/Ticket/Display.html?id=39999
+
+Imager 0.65 - 20 May 2008
 ===========
 
 Bug fixes:

Modified: trunk/libimager-perl/ICO/imicon.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/ICO/imicon.c?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/ICO/imicon.c (original)
+++ trunk/libimager-perl/ICO/imicon.c Sat Dec 13 02:24:06 2008
@@ -46,13 +46,15 @@
     i_color *line_buf;
     i_color *outp;
     ico_color_t *inp = image->image_data;
-
-    if (!i_int_check_image_file_limits(image->width, image->height, 4, 1)) {
+    int channels = masked || image->bit_count == 32 ? 4 : 3;
+
+    if (!i_int_check_image_file_limits(image->width, image->height, channels, 1)) {
       ico_image_release(image);
       return NULL;
     }
 
-    result = i_img_8_new(image->width, image->height, 4);
+    
+    result = i_img_8_new(image->width, image->height, channels);
     if (!result) {
       ico_image_release(image);
       return NULL;

Modified: trunk/libimager-perl/ICO/msicon.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/ICO/msicon.c?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/ICO/msicon.c (original)
+++ trunk/libimager-perl/ICO/msicon.c Sat Dec 13 02:24:06 2008
@@ -9,6 +9,8 @@
 int read_packed(io_glue *ig, const char *format, ...);
 static int 
 read_palette(ico_reader_t *file, ico_image_t *image, int *error);
+static int 
+read_24bit_data(ico_reader_t *file, ico_image_t *image, int *error);
 static int 
 read_32bit_data(ico_reader_t *file, ico_image_t *image, int *error);
 static int 
@@ -256,7 +258,8 @@
     return NULL;
   }
 
-  if (bit_count != 1 && bit_count != 4 && bit_count != 8 && bit_count != 32) {
+  if (bit_count != 1 && bit_count != 4 && bit_count != 8
+      && bit_count != 24 && bit_count != 32) {
     *error = ICOERR_Unknown_Bits;
     return 0;
   }
@@ -286,6 +289,21 @@
       return NULL;
     }
     if (!read_32bit_data(file, result, error)) {
+      free(result->image_data);
+      free(result);
+      return NULL;
+    }
+  }
+  else if (bit_count == 24) {
+    result->palette_size = 0;
+
+    result->image_data = malloc(result->width * result->height * sizeof(ico_color_t));
+    if (!result->image_data) {
+      free(result);
+      *error = ICOERR_Out_Of_Memory;
+      return NULL;
+    }
+    if (!read_24bit_data(file, result, error)) {
       free(result->image_data);
       free(result);
       return NULL;
@@ -773,6 +791,56 @@
       outp->a = inp[3];
       ++outp;
       inp += 4;
+    }
+  }
+  free(buffer);
+
+  return 1;
+}
+
+/*
+=item read_24bit_data
+
+Reads 24 bit image data.
+
+=cut
+*/
+
+static
+int
+read_24bit_data(ico_reader_t *file, ico_image_t *image, int *error) {
+  int line_bytes = image->width * 3;
+  unsigned char *buffer;
+  int y;
+  int x;
+  unsigned char *inp;
+  ico_color_t *outp;
+
+  line_bytes = (line_bytes + 3) / 4 * 4;
+
+  buffer = malloc(line_bytes);
+
+  if (!buffer) {
+    *error = ICOERR_Out_Of_Memory;
+    return 0;
+  }
+
+  for (y = image->height - 1; y >= 0; --y) {
+    if (i_io_read(file->ig, buffer, line_bytes) != line_bytes) {
+      free(buffer);
+      *error = ICOERR_Short_File;
+      return 0;
+    }
+    outp = image->image_data;
+    outp += y * image->width;
+    inp = buffer;
+    for (x = 0; x < image->width; ++x) {
+      outp->b = inp[0];
+      outp->g = inp[1];
+      outp->r = inp[2];
+      outp->a = 255;
+      ++outp;
+      inp += 3;
     }
   }
   free(buffer);

Modified: trunk/libimager-perl/ICO/t/t10icon.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/ICO/t/t10icon.t?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/ICO/t/t10icon.t (original)
+++ trunk/libimager-perl/ICO/t/t10icon.t Sat Dec 13 02:24:06 2008
@@ -1,6 +1,6 @@
 #!perl -w
 use strict;
-use Test::More tests => 98;
+use Test::More tests => 100;
 use Imager::Test qw(is_image);
 
 BEGIN { use_ok('Imager::File::ICO'); }
@@ -361,3 +361,13 @@
   is($im2->type, 'direct', 'expect a direct image');
   is_image($im2, $imcopy, 'check against expected');
 }
+
+{
+  # read 24-bit images
+  my $im = Imager->new;
+  ok($im->read(file => 'testimg/rgb1616.ico'), "read 24-bit data image")
+    or print "# ", $im->errstr, "\n";
+  my $vs = Imager->new(xsize => 16, ysize => 16);
+  $vs->box(filled => 1, color => '#333366');
+  is_image($im, $vs, "check we got the right colors");
+}

Modified: trunk/libimager-perl/Imager.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/Imager.pm?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/Imager.pm (original)
+++ trunk/libimager-perl/Imager.pm Sat Dec 13 02:24:06 2008
@@ -173,7 +173,7 @@
 BEGIN {
   require Exporter;
   @ISA = qw(Exporter);
-  $VERSION = '0.65';
+  $VERSION = '0.67';
   eval {
     require XSLoader;
     XSLoader::load(Imager => $VERSION);

Modified: trunk/libimager-perl/Imager.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/Imager.xs?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/Imager.xs (original)
+++ trunk/libimager-perl/Imager.xs Sat Dec 13 02:24:06 2008
@@ -719,14 +719,12 @@
 
   sv = hv_fetch(hv, "colors", 6, 0);
   if (!sv || !*sv || !SvROK(*sv) || SvTYPE(SvRV(*sv)) != SVt_PVAV) {
-    SV *ref;
-    av = newAV();
-    ref = newRV_inc((SV*) av);
-    sv = hv_store(hv, "colors", 6, ref, 0);
+    /* nothing to do */
+    return;
   }
-  else {
-    av = (AV *)SvRV(*sv);
-  }
+
+  av = (AV *)SvRV(*sv);
+  av_clear(av);
   av_extend(av, quant->mc_count+1);
   for (i = 0; i < quant->mc_count; ++i) {
     i_color *in = quant->mc_colors+i;
@@ -734,9 +732,7 @@
     work = sv_newmortal();
     sv_setref_pv(work, "Imager::Color", (void *)c);
     SvREFCNT_inc(work);
-    if (!av_store(av, i, work)) {
-      SvREFCNT_dec(work);
-    }
+    av_push(av, work);
   }
 }
 

Modified: trunk/libimager-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/MANIFEST?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/MANIFEST (original)
+++ trunk/libimager-perl/MANIFEST Sat Dec 13 02:24:06 2008
@@ -40,6 +40,7 @@
 ICO/testimg/pal43232.ppm
 ICO/testimg/pal83232.ico
 ICO/testimg/pal83232.ppm
+ICO/testimg/rgb1616.ico
 ICO/testimg/rgba3232.ico
 ICO/testimg/rgba3232.ppm
 Imager.pm
@@ -268,6 +269,7 @@
 t/t80texttools.t        Test text wrapping
 t/t81hlines.t		Test hlines.c
 t/t82inline.t           Test Inline::C integration
+t/t83extutil.t		Test Imager::ExtUtils
 t/t90cc.t
 t/t91pod.t		Test POD with Test::Pod
 t/t92samples.t

Modified: trunk/libimager-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/META.yml?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/META.yml (original)
+++ trunk/libimager-perl/META.yml Sat Dec 13 02:24:06 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name: Imager
-version: 0.65
+version: 0.67
 version_from: Imager.pm
 author:
  - Tony Cook <tony at imager.perl.org>
@@ -17,4 +17,4 @@
 meta-spec:
   version: 1.3
   url: http://module-build.sourceforge.net/META-spec-v1.3.html
-generated_by: Imager version 0.65
+generated_by: Imager version 0.67

Modified: trunk/libimager-perl/bmp.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/bmp.c?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/bmp.c (original)
+++ trunk/libimager-perl/bmp.c Sat Dec 13 02:24:06 2008
@@ -367,7 +367,7 @@
 
   if (!write_packed(ig, "CCVvvVVVVvvVVVVVV", 'B', 'M', data_size+offset, 
 		    0, 0, offset, INFOHEAD_SIZE, im->xsize, im->ysize, 1, 
-		    bit_count, BI_RGB, 0, (int)(xres+0.5), (int)(yres+0.5), 
+		    bit_count, BI_RGB, data_size, (int)(xres+0.5), (int)(yres+0.5), 
 		    colors_used, colors_used)){
     i_push_error(0, "cannot write bmp header");
     return 0;

Modified: trunk/libimager-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/debian/changelog?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/debian/changelog (original)
+++ trunk/libimager-perl/debian/changelog Sat Dec 13 02:24:06 2008
@@ -1,10 +1,22 @@
-libimager-perl (0.65-2) UNRELEASED; urgency=low
-
+libimager-perl (0.67-1) unstable; urgency=low
+  
+  [ gregor herrmann ]
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
     (source stanza).
   * debian/control: Added: ${misc:Depends} to Depends: field.
 
- -- gregor herrmann <gregoa at debian.org>  Sun, 16 Nov 2008 20:43:53 +0100
+  [ Rene Mayorga ]
+  * New upstream release
+  * debian/control
+    + use debhelper version 7
+    + Set standards-version to 3.8.0
+    + add myself to uploaders
+  * debian/copyright updated using dh-make-perl.
+    Add debian/* copyright stanza based on the
+    names from changelog
+  * debian/rules updated using dh-make-perl
+
+ -- Rene Mayorga <rmayorga at debian.org.sv>  Fri, 12 Dec 2008 19:47:41 -0600
 
 libimager-perl (0.65-1) unstable; urgency=low
 

Modified: trunk/libimager-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/debian/compat?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/debian/compat (original)
+++ trunk/libimager-perl/debian/compat Sat Dec 13 02:24:06 2008
@@ -1,1 +1,1 @@
-6
+7

Modified: trunk/libimager-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/debian/control?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/debian/control (original)
+++ trunk/libimager-perl/debian/control Sat Dec 13 02:24:06 2008
@@ -1,15 +1,15 @@
 Source: libimager-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 6), perl (>= 5.8.0-7), libgif-dev, 
+Build-Depends: debhelper (>= 7), perl (>= 5.8.0-7), libgif-dev, 
  libtiff4-dev, libpng12-dev, libjpeg62-dev, libfreetype6-dev, libt1-dev, 
  libtest-pod-perl, libtest-pod-coverage-perl, libinline-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Jay Bonci <jaybonci at debian.org>, Esteban Manchado Velázque
  <zoso at debian.org>, Gunnar Wolf <gwolf at debian.org>,
  Damyan Ivanov <dmn at debian.org>,
- gregor herrmann <gregoa at debian.org>
-Standards-Version: 3.7.3
+ gregor herrmann <gregoa at debian.org>, Rene Mayorga <rmayorga at debian.org.sv>
+Standards-Version: 3.8.0
 Homepage: http://imager.perl.org/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libimager-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libimager-perl/

Modified: trunk/libimager-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/debian/copyright?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/debian/copyright (original)
+++ trunk/libimager-perl/debian/copyright Sat Dec 13 02:24:06 2008
@@ -1,36 +1,25 @@
-This is the debian package for the Imager module.
-It was created by Michael K. Edwards <medwards-debian at sane.net> using dh-make-perl.
-
-Upstream source location: http://search.cpan.org/dist/Imager/
-
-The upstream author is: 
-
-Arnar M. Hrafnkelsson (addi at imager.perl.org) and Tony Cook
-(tony at imager.perl.org) See the README for a complete list.
+Format-Specification:
+    http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
+Upstream-Maintainer: Tony Cook <tony at imager.perl.org>, Arnar M. Hrafnkelsson
+Upstream-Source: http://search.cpan.org/dist/Imager/
+Upstream-Name: Imager
 
 Files: *
 Copyright: (c) 1999-2004 Arnar M. Hrafnkelsson. All rights reserved.
- (c) 2004-2007 Anthony Cook.
+ (c) Tony Cook <tony at imager.perl.org>
+License-Alias: Perl
 License: Artistic | GPL-1+
- This program is free software; you can redistribute it and/or
- modify it under the same terms as Perl itself.
 
 Files: ppport.h
-Copyright: 
+Copyright:
  Version 3.x, Copyright (c) 2004-2005, Marcus Holland-Moritz.
  Version 2.x, Copyright (C) 2001, Paul Marquess.
  Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
 License: Artistic | GPL-1+
- This program is free software; you can redistribute it and/or
- modify it under the same terms as Perl itself.
-Perl is distributed under your choice of the GNU General Public License or
-the Artistic License.  On Debian GNU/Linux systems, the complete text of the
-GNU General Public License can be found in `/usr/share/common-licenses/GPL'
-and the Artistic Licence in `/usr/share/common-licenses/Artistic'.
 
 Files: lib/Imager/Color/Table.pm
 Copyright:(C) 2004 X Consortium
-License: other 
+License: other
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to
  deal in the Software without restriction, including without limitation the
@@ -64,3 +53,27 @@
  copyright notice and this permission notice appear in supporting
  documentation.  This software is provided "as is" without express or
  implied warranty.
+
+Files: debian/*
+Copyright: 2004, Michael K. Edwards <medwards-debian at sane.net>
+ (c) 2004-2007, Jay Bonci <jaybonci at debian.org>
+ (c) 2007, Gunnar Wolf <gwolf at debian.org>
+ (c) 2008, Roberto C. Sanchez <roberto at debian.org>
+ (c) 2008, Damyan Ivanov <dmn at debian.org>
+ (c) 2008, gregor herrmann <gregoa at debian.org>
+
+License: Artistic | GPL-1+
+
+License: Artistic
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the Artistic License, which comes with Perl.
+    On Debian GNU/Linux systems, the complete text of the Artistic License
+    can be found in /usr/share/common-licenses/Artistic
+
+License: GPL-1+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by 
+    the Free Software Foundation; either version 1, or (at your option)
+    any later version.
+    On Debian GNU/Linux systems, the complete text of the GNU General
+    Public License can be found in `/usr/share/common-licenses/GPL'

Added: trunk/libimager-perl/debian/libimager-perl.docs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/debian/libimager-perl.docs?rev=28171&op=file
==============================================================================
--- trunk/libimager-perl/debian/libimager-perl.docs (added)
+++ trunk/libimager-perl/debian/libimager-perl.docs Sat Dec 13 02:24:06 2008
@@ -1,0 +1,1 @@
+README

Added: trunk/libimager-perl/debian/libimager-perl.examples
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/debian/libimager-perl.examples?rev=28171&op=file
==============================================================================
--- trunk/libimager-perl/debian/libimager-perl.examples (added)
+++ trunk/libimager-perl/debian/libimager-perl.examples Sat Dec 13 02:24:06 2008
@@ -1,0 +1,1 @@
+samples/*

Modified: trunk/libimager-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/debian/rules?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/debian/rules (original)
+++ trunk/libimager-perl/debian/rules Sat Dec 13 02:24:06 2008
@@ -1,76 +1,27 @@
 #!/usr/bin/make -f
-# This debian/rules file is provided as a template for normal perl
-# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
-# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
-# be used freely wherever it is useful.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# If set to a true value then MakeMaker's prompt function will
-# always return the default without waiting for user input.
-export PERL_MM_USE_DEFAULT=1
-
 PERL   ?= /usr/bin/perl
-PACKAGE = $(shell dh_listpackages)
-TMP     = $(CURDIR)/debian/$(PACKAGE)
-
-# Allow disabling build optimisation by setting noopt in
-# $DEB_BUILD_OPTIONS
-CFLAGS = -Wall -g
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-        CFLAGS += -O0
-else
-        CFLAGS += -O2
-endif
-
 build: build-stamp
 build-stamp:
-	dh_testdir
+	dh build --before configure
 	$(PERL) Makefile.PL INSTALLDIRS=vendor --disable=TT-fonts,ungif
-	$(MAKE) OPTIMIZE="$(CFLAGS)" LD_RUN_PATH=""
-	$(MAKE) test
+	dh build --after configure
 	touch $@
 
 clean:
-	dh_testdir
-	dh_testroot
 	rm -f imconfig.h
 	rm -f ICO/testout/*
-	dh_clean build-stamp install-stamp
-	[ ! -f Makefile ] || $(MAKE) realclean
+	dh $@
 
 install: install-stamp
 install-stamp: build-stamp
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-	$(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
-	[ ! -d $(TMP)/usr/share/perl5 ] || \
-		rmdir --ignore-fail-on-non-empty --parents --verbose \
-		$(TMP)/usr/share/perl5
+	dh install
 	touch $@
 
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do here for an architecture-dependent package
+binary-arch: install
+	dh $@
 
-# Build architecture-dependent files here.
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installexamples samples/*
-	dh_installdocs README
-	dh_installchangelogs Changes
-	dh_shlibdeps
-	dh_strip
-	dh_perl
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
+binary-indep:
 
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+binary: binary-arch binary-indep
+
+.PHONY: binary binary-arch binary-indep install clean build

Modified: trunk/libimager-perl/lib/Imager/ExtUtils.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/lib/Imager/ExtUtils.pm?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/lib/Imager/ExtUtils.pm (original)
+++ trunk/libimager-perl/lib/Imager/ExtUtils.pm Sat Dec 13 02:24:06 2008
@@ -1,9 +1,10 @@
 package Imager::ExtUtils;
 use strict;
+use File::Spec;
 
 use vars qw($VERSION);
 
-$VERSION = "1.001";
+$VERSION = "1.002";
 
 =head1 NAME
 
@@ -27,9 +28,13 @@
 
 # figure out where Imager is installed
 sub base_dir {
-  for my $dir (@INC) {
-    if (-e "$dir/Imager.pm") {
-      return $dir;
+  for my $inc_dir (@INC) {
+    if (-e "$inc_dir/Imager.pm") {
+      my $base_dir = $inc_dir;
+      unless (File::Spec->file_name_is_absolute($base_dir)) {
+	$base_dir = File::Spec->rel2abs($base_dir);
+      }
+      return $base_dir;
     }
   }
 

Modified: trunk/libimager-perl/lib/Imager/Files.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/lib/Imager/Files.pod?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/lib/Imager/Files.pod (original)
+++ trunk/libimager-perl/lib/Imager/Files.pod Sat Dec 13 02:24:06 2008
@@ -8,10 +8,19 @@
   $img->write(file=>$filename, type=>$type)
     or die "Cannot write: ",$img->errstr;
 
+  # type is optional if we can guess the format from the filename
+  $img->write(file => "foo.png")
+    or die "Cannot write: ",$img->errstr;
+
   $img = Imager->new;
   $img->read(file=>$filename, type=>$type)
     or die "Cannot read: ", $img->errstr;
 
+  # type is optional if we can guess the type from the file data
+  # and we normally can guess
+  $img->read(file => $filename)
+    or die "Cannot read: ", $img->errstr;
+
   Imager->write_multi({ file=> $filename, ... }, @images)
     or die "Cannot write: ", Imager->errstr;
 
@@ -22,6 +31,24 @@
 
   my @read_types = Imager->read_types;
   my @write_types = Imager->write_types;
+
+  # we can write/write_multi to things other than filenames
+  my $data;
+  $img->write(data => \$data, type => $type) or die;
+
+  my $fh = ... ; # eg. IO::File
+  $img->write(fh => $fh, type => $type) or die;
+
+  $img->write(fd => fileno($fh), type => $type) or die;
+
+  # some file types need seek callbacks too
+  $img->write(callback => \&write_callback, type => $type) or die;
+
+  # and similarly for read/read_multi
+  $img->read(data => $data) or die;
+  $img->read(fh => $fh) or die;
+  $img->read(fd => fileno($fh)) or die;
+  $img->read(callback => \&read_callback) or die;
 
 =head1 DESCRIPTION
 
@@ -164,7 +191,7 @@
   $image->read(file => 'example.tif')
     or die $image->errstr;
 
-=item 
+=item *
 
 fh - C<fh> is a file handle, typically either returned from
 C<<IO::File->new()>>, or a glob from an C<open> call.  You should call
@@ -181,7 +208,7 @@
   $image->read(fd => $cgi->param('file')) 
     or die $image->errstr;
 
-=item 
+=item *
 
 fd - C<fd> is a file descriptor.  You can get this by calling the
 C<fileno()> function on a file handle, or by using one of the standard
@@ -194,7 +221,7 @@
   $image->write(fd => file(STDOUT), type => 'gif')
     or die $image->errstr;
 
-=item 
+=item *
 
 data - When reading data, C<data> is a scalar containing the image
 file data, when writing, C<data> is a reference to the scalar to save
@@ -725,6 +752,10 @@
 C<gif_consolidate> parameter set to a true value:
 
   $img->read(file=>$some_gif_file, gif_consolidate=>1);
+
+As with the to_paletted() method, if you supply a colors parameter as
+a reference to an array, this will be filled with Imager::Color
+objects of the color table generated for the image file.
 
 =head2 TIFF (Tagged Image File Format)
 

Modified: trunk/libimager-perl/lib/Imager/Font/BBox.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/lib/Imager/Font/BBox.pm?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/lib/Imager/Font/BBox.pm (original)
+++ trunk/libimager-perl/lib/Imager/Font/BBox.pm Sat Dec 13 02:24:06 2008
@@ -71,24 +71,53 @@
   return $_[0][0];
 }
 
-=item end_offset
-
-=item pos_width
-
-The offset from the selected drawing location to the right edge of the
-last character drawn.  Should always be positive.
-
-You can use the alias pos_width() if you are used to the
-bounding_box() documentation for list context.
-
-=cut
-
-sub end_offset {
-  return $_[0][2];
-}
-
-sub pos_width {
-  return $_[0][2];
+=item advance_width()
+
+The advance width of the string, if the driver supports that,
+otherwise the same as end_offset.
+
+=cut
+
+sub advance_width {
+  my $self = shift;
+
+  @$self > 6 ? $self->[6] : $self->[2];
+}
+
+=item right_bearing
+
+The distance from the right of the last glyph to the end of the advance
+point.
+
+If the glyph overflows the right side of the advance width this value
+is negative.
+
+=cut
+
+sub right_bearing {
+  my $self = shift;
+
+  @$self >= 8 && return $self->[7]; # driver gives it to us
+
+  # otherwise the closest we have is the difference between the 
+  # end_pos and advance_width
+  return $self->advance_width - $self->pos_width;
+}
+
+=item display_width
+
+The distance from the left-most pixel of the left-most glyph to the
+right-most pixel of the right-most glyph.
+
+Equals advance_width - left_bearing - right_bearing (and implemented
+that way.)
+
+=cut
+
+sub display_width {
+  my ($self) = @_;
+
+  $self->advance_width - $self->left_bearing - $self->right_bearing;
 }
 
 =item global_descent()
@@ -139,23 +168,47 @@
   return $_[0][5];
 }
 
-=item advance_width()
-
-The advance width of the string, if the driver supports that,
-otherwise the same as end_offset.
-
-=cut
-
-sub advance_width {
-  my $self = shift;
-
-  @$self > 6 ? $self->[6] : $self->[2];
-}
+=item font_height()
+
+The maximum displayed height of any string using this font.
+
+=cut
+
+sub font_height {
+  my $self = shift;
+  $self->global_ascent - $self->global_descent;
+}
+
+=item text_height()
+
+The displayed height of the supplied string.
+
+=cut
+
+sub text_height {
+  my $self = shift;
+
+  $self->ascent - $self->descent;
+}
+
+=back
+
+=head1 OBSOLETE METHODS
+
+These methods include bugs kept for backwards compatibility and
+shouldn't be used in new code.
+
+=over
 
 =item total_width()
 
 The total displayed width of the string.
 
+New code should use display_width().
+
+This depends on end_offset(), and is limited by it's backward
+compatibility.
+
 =cut
 
 sub total_width {
@@ -164,63 +217,27 @@
   $self->end_offset - $self->start_offset;
 }
 
-=item font_height()
-
-The maximum displayed height of any string using this font.
-
-=cut
-
-sub font_height {
-  my $self = shift;
-  $self->global_ascent - $self->global_descent;
-}
-
-=item text_height()
-
-The displayed height of the supplied string.
-
-=cut
-
-sub text_height {
-  my $self = shift;
-
-  $self->ascent - $self->descent;
-}
-
-=item right_bearing
-
-The distance from the right of the last glyph to the end of the advance
-point.
-
-If the glyph overflows the right side of the advance width this value
-is negative.
-
-=cut
-
-sub right_bearing {
-  my $self = shift;
-
-  @$self >= 8 && return $self->[7]; # driver gives it to us
-
-  # otherwise the closest we have is the difference between the 
-  # end_pos and advance_width
-  return $self->advance_width - $self->pos_width;
-}
-
-=item display_width
-
-The distance from the left-most pixel of the left-most glyph to the
-right-most pixel of the right-most glyph.
-
-Equals advance_width - left_bearing - right_bearing (and implemented
-that way.)
-
-=cut
-
-sub display_width {
-  my ($self) = @_;
-
-  $self->advance_width - $self->left_bearing - $self->right_bearing;
+=item end_offset
+
+=item pos_width
+
+The offset from the selected drawing location to the right edge of the
+last character drawn.  Should always be positive.
+
+You can use the alias pos_width() if you are used to the
+bounding_box() documentation for list context.
+
+For backwards compatibility this method returns the maximum of the
+advance width and the offset of the right edge of the last glyph.
+
+=cut
+
+sub end_offset {
+  return $_[0][2];
+}
+
+sub pos_width {
+  return $_[0][2];
 }
 
 =back

Modified: trunk/libimager-perl/lib/Imager/ImageTypes.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/lib/Imager/ImageTypes.pod?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/lib/Imager/ImageTypes.pod (original)
+++ trunk/libimager-perl/lib/Imager/ImageTypes.pod Sat Dec 13 02:24:06 2008
@@ -847,7 +847,8 @@
 =item colors
 
 A arrayref of colors that are fixed.  Note that some color generators
-will ignore this.
+will ignore this.  If this is supplied it will be filled with the
+color table generated for the image.
 
 =item transp
 
@@ -989,8 +990,8 @@
 
 A arrayref containing Imager::Color objects, which represents the
 starting set of colors to use in translating the images.  webmap will
-ignore this.  The final colors used are copied back into this array
-(which is expanded if necessary.)
+ignore this.  On return the final colors used are copied back into
+this array (which is expanded if necessary.)
 
 =item max_colors
 
@@ -1120,7 +1121,7 @@
 
 =head1 REVISION
 
-$Revision: 1435 $
+$Revision: 1546 $
 
 =head1 AUTHORS
 

Modified: trunk/libimager-perl/rubthru.im
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/rubthru.im?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/rubthru.im (original)
+++ trunk/libimager-perl/rubthru.im Sat Dec 13 02:24:06 2008
@@ -121,7 +121,7 @@
       ttx = work_left;
       IM_GLIN(im, work_left, work_left + work_width, tty, dest_line);
       
-      for(x = src_minx; x < src_maxx; x++) {
+      for(x = min_x; x < max_x; x++) {
 	src_alpha = srcp->channel[alphachan];
 	if (src_alpha) {
 	  remains = IM_SAMPLE_MAX - src_alpha;

Modified: trunk/libimager-perl/t/t023palette.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/t/t023palette.t?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/t/t023palette.t (original)
+++ trunk/libimager-perl/t/t023palette.t Sat Dec 13 02:24:06 2008
@@ -1,10 +1,10 @@
 #!perl -w
 # some of this is tested in t01introvert.t too
 use strict;
-use Test::More tests => 121;
+use Test::More tests => 126;
 BEGIN { use_ok("Imager"); }
 
-use Imager::Test qw(image_bounds_checks);
+use Imager::Test qw(image_bounds_checks test_image is_color3);
 
 sub isbin($$$);
 
@@ -329,6 +329,20 @@
   image_bounds_checks($im);
 }
 
+{ # test colors array returns colors
+  my $data;
+  my $im = test_image();
+  my @colors;
+  my $imp = $im->to_paletted(colors => \@colors, 
+			     make_colors => 'webmap', 
+			     translate => 'closest');
+  ok($imp, "made paletted");
+  is(@colors, 216, "should be 216 colors in the webmap");
+  is_color3($colors[0], 0, 0, 0, "first should be 000000");
+  is_color3($colors[1], 0, 0, 0x33, "second should be 000033");
+  is_color3($colors[8], 0, 0x33, 0x66, "9th should be 003366");
+}
+
 sub iscolor {
   my ($c1, $c2, $msg) = @_;
 

Modified: trunk/libimager-perl/t/t105gif.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/t/t105gif.t?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/t/t105gif.t (original)
+++ trunk/libimager-perl/t/t105gif.t Sat Dec 13 02:24:06 2008
@@ -12,9 +12,9 @@
 
 use strict;
 $|=1;
-use Test::More tests => 140;
+use Test::More tests => 145;
 use Imager qw(:all);
-use Imager::Test qw(is_color3);
+use Imager::Test qw(is_color3 test_image);
 
 use Carp 'confess';
 $SIG{__DIE__} = sub { confess @_ };
@@ -51,7 +51,7 @@
     cmp_ok($im->errstr, '=~', "format 'gif' not supported", "check no gif message");
     ok(!grep($_ eq 'gif', Imager->read_types), "check gif not in read types");
     ok(!grep($_ eq 'gif', Imager->write_types), "check gif not in write types");
-    skip("no gif support", 134);
+    skip("no gif support", 139);
   }
     open(FH,">testout/t105.gif") || die "Cannot open testout/t105.gif\n";
     binmode(FH);
@@ -742,6 +742,23 @@
     is($result[1]->tags(name => 'gif_top'), 0,
        "check second gif_top");
   }
+
+  { # test colors array returns colors
+    my $data;
+    my $im = test_image();
+    my @colors;
+    ok($im->write(data => \$data, 
+		  colors => \@colors, 
+		  make_colors => 'webmap', 
+		  translate => 'closest',
+		  gifquant => 'gen',
+		  type => 'gif'),
+       "write using webmap to check color table");
+    is(@colors, 216, "should be 216 colors in the webmap");
+    is_color3($colors[0], 0, 0, 0, "first should be 000000");
+    is_color3($colors[1], 0, 0, 0x33, "second should be 000033");
+    is_color3($colors[8], 0, 0x33, 0x66, "9th should be 003366");
+  }
 }
 
 sub test_readgif_cb {

Modified: trunk/libimager-perl/t/t107bmp.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimager-perl/t/t107bmp.t?rev=28171&op=diff
==============================================================================
--- trunk/libimager-perl/t/t107bmp.t (original)
+++ trunk/libimager-perl/t/t107bmp.t Sat Dec 13 02:24:06 2008
@@ -1,8 +1,8 @@
 #!perl -w
 use strict;
-use Test::More tests => 211;
+use Test::More tests => 213;
 use Imager qw(:all);
-use Imager::Test qw(test_image_raw is_image is_color3);
+use Imager::Test qw(test_image_raw is_image is_color3 test_image);
 init_log("testout/t107bmp.log",1);
 
 my $debug_writes = 0;
@@ -645,6 +645,14 @@
 	    "check color came through");
   is_color3($imread->getpixel('x' => 0, 'y' => 15), 127, 96, 96,
 	    "check translucent came through");
+}
+
+{ # RT 41406
+  my $data;
+  my $im = test_image();
+  ok($im->write(data => \$data, type => 'bmp'), "write using OO");
+  my $size = unpack("V", substr($data, 34, 4));
+  is($size, 67800, "check data size");
 }
 
 sub write_test {




More information about the Pkg-perl-cvs-commits mailing list