From: Tony Cook Date: Mon, 25 Oct 2004 14:10:49 +0000 (+0000) Subject: - renamed io.h to imio.h to prevent problems building under cygwin. X-Git-Tag: Imager-0.48^2~306 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/7ac6a2e94b36fac75cf949ea96c0b0dabac88528 - renamed io.h to imio.h to prevent problems building under cygwin. resolve https://rt.cpan.org/Ticket/Display.html?id=7948 - i_writegif_low() wasn't setting the returned global palette, which meant a rubbish palette was returned to the user (detected with valgrind) --- diff --git a/Changes b/Changes index d9c417cf..1655250a 100644 --- a/Changes +++ b/Changes @@ -873,6 +873,10 @@ Revision history for Perl extension Imager. - resolves https://rt.cpan.org/Ticket/Display.html?id=7949 - the type 1 glyph_names() method didn't do correct error handling when the string parameter wasn't supplied +- renamed io.h to imio.h to prevent problems building under cygwin. + resolve https://rt.cpan.org/Ticket/Display.html?id=7948 +- i_writegif_low() wasn't setting the returned global palette, which + meant a rubbish palette was returned to the user (detected with valgrind) ================================================================= diff --git a/Imager.pm b/Imager.pm index 34a6e9aa..b8cc59e8 100644 --- a/Imager.pm +++ b/Imager.pm @@ -147,7 +147,7 @@ BEGIN { require Exporter; require DynaLoader; - $VERSION = '0.43_01'; + $VERSION = '0.43_02'; @ISA = qw(Exporter DynaLoader); bootstrap Imager $VERSION; } diff --git a/MANIFEST b/MANIFEST index 741fa4d7..0cff47aa 100644 --- a/MANIFEST +++ b/MANIFEST @@ -27,7 +27,7 @@ feat.h img16.c imgdouble.c Implements double/sample images io.c -io.h +imio.h log.c log.h jpeg.c diff --git a/Makefile.PL b/Makefile.PL index d955c2fe..16d4ae02 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -75,6 +75,7 @@ if (defined $Config{'d_dlsymun'}) { $OSDEF .= ' -DDLSYMUN'; } 'INC' => "$DFLAGS $F_INC", 'OBJECT' => join(' ', @objs, $F_OBJECT), clean => { FILES=>'testout' }, + 'NO_META' => 1, ); if ($] ge '5.005') { diff --git a/TODO b/TODO index 721fa3da..42b56bbc 100644 --- a/TODO +++ b/TODO @@ -165,6 +165,8 @@ Format specific issues: - read more metadata from images, esp tiff tags, EXIF format information from TIFF and JPEG. +- handle 16-bit/sample pgm/ppm files + Documentation: - Add to the documentation - Write a tutorial? @@ -189,3 +191,4 @@ Build/configure: for example), instead of putting these directly into the search path search for the freetype{2}?/someheader and then add the subdirectory if we find the file in that directory. +- switch to Test::More diff --git a/datatypes.c b/datatypes.c index ec8e9535..41c9e6af 100644 --- a/datatypes.c +++ b/datatypes.c @@ -1,4 +1,4 @@ -#include "io.h" +#include "imio.h" #include "datatypes.h" #include #include diff --git a/datatypes.h b/datatypes.h index 5fa528dd..9270d2c0 100644 --- a/datatypes.h +++ b/datatypes.h @@ -1,7 +1,7 @@ #ifndef _DATATYPES_H_ #define _DATATYPES_H_ -#include "io.h" +#include "imio.h" #define MAXCHANNELS 4 diff --git a/gif.c b/gif.c index 9f3f3978..0592828d 100644 --- a/gif.c +++ b/gif.c @@ -1663,6 +1663,7 @@ i_writegif_low(i_quantize *quant, GifFileType *gf, i_img **imgs, int count) { if ((map = make_gif_map(quant, imgs[0], want_trans)) == NULL) { i_mempool_destroy(&mp); EGifCloseFile(gf); + quant->mc_colors = orig_colors; mm_log((1, "Error in MakeMapObject")); return 0; } @@ -1851,6 +1852,12 @@ i_writegif_low(i_quantize *quant, GifFileType *gf, i_img **imgs, int count) { mm_log((1, "Error in EGifCloseFile\n")); return 0; } + if (glob_colors) { + int i; + for (i = 0; i < glob_color_count; ++i) + orig_colors[i] = glob_colors[i]; + } + i_mempool_destroy(&mp); quant->mc_colors = orig_colors; diff --git a/image.c b/image.c index 4fd56b4a..8dfdb092 100644 --- a/image.c +++ b/image.c @@ -1,6 +1,5 @@ #include "image.h" #include "imagei.h" -#include "io.h" /* =head1 NAME diff --git a/image.h b/image.h index 87912b2d..c1f99ad4 100644 --- a/image.h +++ b/image.h @@ -1,7 +1,7 @@ #ifndef _IMAGE_H_ #define _IMAGE_H_ -#include "io.h" +#include "imio.h" #include "iolayer.h" #include "log.h" #include "stackmach.h" diff --git a/io.c b/io.c index 1fdbed52..9c705fae 100644 --- a/io.c +++ b/io.c @@ -1,4 +1,4 @@ -#include "io.h" +#include "imio.h" #include #ifndef _MSC_VER #include diff --git a/iolayer.c b/iolayer.c index caec2a26..7b16142b 100644 --- a/iolayer.c +++ b/iolayer.c @@ -1,4 +1,4 @@ -#include "io.h" +#include "imio.h" #include "iolayer.h" #include "log.h" #include diff --git a/pnm.c b/pnm.c index 9dccf991..9f62522e 100644 --- a/pnm.c +++ b/pnm.c @@ -1,5 +1,4 @@ #include "image.h" -#include "io.h" #include "log.h" #include "iolayer.h" diff --git a/quant.c b/quant.c index 1f7e9c9f..2a23b107 100644 --- a/quant.c +++ b/quant.c @@ -410,6 +410,9 @@ makemap_addi(i_quantize *quant, i_img **imgs, int count) { i_sample_t *line; const int *sample_indices; + mm_log((1, "makemap_addi(quant %p { mc_count=%d, mc_colors=%p }, imgs %p, count %d)\n", + quant, quant->mc_count, quant->mc_colors, imgs, count)); + i_mempool_init(&mp); clr = i_mempool_alloc(&mp, sizeof(cvec) * quant->mc_size); @@ -423,6 +426,10 @@ makemap_addi(i_quantize *quant, i_img **imgs, int count) { } /* mymalloc doesn't clear memory, so I think we need this */ for (; i < quant->mc_size; ++i) { + /*clr[i].r = clr[i].g = clr[i].b = 0;*/ + clr[i].dr = 0; + clr[i].dg = 0; + clr[i].db = 0; clr[i].fixed = 0; clr[i].mcount = 0; } @@ -545,6 +552,12 @@ makemap_addi(i_quantize *quant, i_img **imgs, int count) { quant->mc_count = cnum; #endif +#if 0 + mm_log((1, "makemap_addi returns - quant.mc_count = %d\n", quant->mc_count)); + for (i = 0; i < quant->mc_count; ++i) + mm_log((5, " map entry %d: (%d, %d, %d)\n", i, clr[i].r, clr[i].g, clr[i].b)); +#endif + i_mempool_destroy(&mp); } diff --git a/rgb.c b/rgb.c index b264c5a6..8941a501 100644 --- a/rgb.c +++ b/rgb.c @@ -1,5 +1,4 @@ #include "image.h" -#include "io.h" #include "log.h" #include "iolayer.h" diff --git a/tga.c b/tga.c index 15d6c0c4..04f684c8 100644 --- a/tga.c +++ b/tga.c @@ -1,5 +1,4 @@ #include "image.h" -#include "io.h" #include "log.h" #include "iolayer.h"