]> git.imager.perl.org - imager.git/commitdiff
- renamed io.h to imio.h to prevent problems building under cygwin.
authorTony Cook <tony@develop=help.com>
Mon, 25 Oct 2004 14:10:49 +0000 (14:10 +0000)
committerTony Cook <tony@develop=help.com>
Mon, 25 Oct 2004 14:10:49 +0000 (14:10 +0000)
  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)

16 files changed:
Changes
Imager.pm
MANIFEST
Makefile.PL
TODO
datatypes.c
datatypes.h
gif.c
image.c
image.h
io.c
iolayer.c
pnm.c
quant.c
rgb.c
tga.c

diff --git a/Changes b/Changes
index d9c417cf4aef4f8fce71772c1b93bc46bf1d66e2..1655250a969f552c0ab226185e61c7e33536174b 100644 (file)
--- 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
 - 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)
 
 =================================================================
 
 
 =================================================================
 
index 34a6e9aab9819ea81cfe72e1afc127b3cdb8b990..b8cc59e83a11f153f31fd20af7a0e2ee6dc7e8f2 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -147,7 +147,7 @@ BEGIN {
   require Exporter;
   require DynaLoader;
 
   require Exporter;
   require DynaLoader;
 
-  $VERSION = '0.43_01';
+  $VERSION = '0.43_02';
   @ISA = qw(Exporter DynaLoader);
   bootstrap Imager $VERSION;
 }
   @ISA = qw(Exporter DynaLoader);
   bootstrap Imager $VERSION;
 }
index 741fa4d771ebe9c40f4c2ff51b15e7bc9775ee9a..0cff47aae0adf3a7f1c975ddfe3b817c3ad8b68a 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -27,7 +27,7 @@ feat.h
 img16.c
 imgdouble.c     Implements double/sample images
 io.c
 img16.c
 imgdouble.c     Implements double/sample images
 io.c
-io.h
+imio.h
 log.c
 log.h
 jpeg.c
 log.c
 log.h
 jpeg.c
index d955c2fe8631eaa7413f74240f2171b87d5a63b1..16d4ae02ea8febb2cccc7e54a17ff90c43336b1c 100644 (file)
@@ -75,6 +75,7 @@ if (defined $Config{'d_dlsymun'}) { $OSDEF  .= ' -DDLSYMUN'; }
        'INC'          => "$DFLAGS $F_INC",
        'OBJECT'       => join(' ', @objs, $F_OBJECT),
        clean          => { FILES=>'testout' },
        'INC'          => "$DFLAGS $F_INC",
        'OBJECT'       => join(' ', @objs, $F_OBJECT),
        clean          => { FILES=>'testout' },
+       'NO_META'      => 1,
       );
 
 if ($] ge '5.005') {
       );
 
 if ($] ge '5.005') {
diff --git a/TODO b/TODO
index 721fa3da2f4e522b2315f095f368fa45fca90812..42b56bbca9f035e4ca030083fbb75124db9bfd9a 100644 (file)
--- 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.
 
 - 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?
 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.
   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
index ec8e953508c0a30e52f99a00dd061fbff0b4b47a..41c9e6afeb719fce94892a72207e2f9352c0cb6e 100644 (file)
@@ -1,4 +1,4 @@
-#include "io.h"
+#include "imio.h"
 #include "datatypes.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include "datatypes.h"
 #include <stdlib.h>
 #include <stdio.h>
index 5fa528dd826c04634c0fa96b0d2d4af007de6913..9270d2c0b03392c15c4a8df350bfc17059b074d3 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _DATATYPES_H_
 #define _DATATYPES_H_
 
 #ifndef _DATATYPES_H_
 #define _DATATYPES_H_
 
-#include "io.h"
+#include "imio.h"
 
 #define MAXCHANNELS 4
 
 
 #define MAXCHANNELS 4
 
diff --git a/gif.c b/gif.c
index 9f3f39789c91eb261f9214b6f47fb8f2f0126849..0592828df9068f845baa0dd20647fbb93baf44bd 100644 (file)
--- 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);
       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;
       }
         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;
   }
     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;
 
   i_mempool_destroy(&mp);
   quant->mc_colors = orig_colors;
 
diff --git a/image.c b/image.c
index 4fd56b4a83668026de9546f42061444996a6b505..8dfdb092fa11437dec279199bb2773a0564d75e0 100644 (file)
--- a/image.c
+++ b/image.c
@@ -1,6 +1,5 @@
 #include "image.h"
 #include "imagei.h"
 #include "image.h"
 #include "imagei.h"
-#include "io.h"
 
 /*
 =head1 NAME
 
 /*
 =head1 NAME
diff --git a/image.h b/image.h
index 87912b2d09bd960caab68c2e63733154e00eadef..c1f99ad4b1ff6d16bc323dd29acde15a5b34aec0 100644 (file)
--- a/image.h
+++ b/image.h
@@ -1,7 +1,7 @@
 #ifndef _IMAGE_H_
 #define _IMAGE_H_
 
 #ifndef _IMAGE_H_
 #define _IMAGE_H_
 
-#include "io.h"
+#include "imio.h"
 #include "iolayer.h"
 #include "log.h"
 #include "stackmach.h"
 #include "iolayer.h"
 #include "log.h"
 #include "stackmach.h"
diff --git a/io.c b/io.c
index 1fdbed52bfd76f8a14dafcd381f168fc91c8d6dc..9c705fae31c591fcaca6119be0373e8399d55946 100644 (file)
--- a/io.c
+++ b/io.c
@@ -1,4 +1,4 @@
-#include "io.h"
+#include "imio.h"
 #include <stdlib.h>
 #ifndef _MSC_VER
 #include <unistd.h>
 #include <stdlib.h>
 #ifndef _MSC_VER
 #include <unistd.h>
index caec2a261f43b781602b0ea6685ed09566b0a26c..7b16142ba7b1191c5fe12477e47fb75005c4bdca 100644 (file)
--- a/iolayer.c
+++ b/iolayer.c
@@ -1,4 +1,4 @@
-#include "io.h"
+#include "imio.h"
 #include "iolayer.h"
 #include "log.h"
 #include <stdlib.h>
 #include "iolayer.h"
 #include "log.h"
 #include <stdlib.h>
diff --git a/pnm.c b/pnm.c
index 9dccf9914b4c62a293ca1cba8fa02f0997b9078b..9f62522e9c8c15c83c5188c5e0250a474b53618d 100644 (file)
--- a/pnm.c
+++ b/pnm.c
@@ -1,5 +1,4 @@
 #include "image.h"
 #include "image.h"
-#include "io.h"
 #include "log.h"
 #include "iolayer.h"
 
 #include "log.h"
 #include "iolayer.h"
 
diff --git a/quant.c b/quant.c
index 1f7e9c9f8ee3b2aea0991dce4d0f1ebc9a3d13bd..2a23b1070624f8a716a525702774589d627da97e 100644 (file)
--- 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;
 
   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);
   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) {
   }
   /* 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;
   }
     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
 
   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);
 }
 
   i_mempool_destroy(&mp);
 }
 
diff --git a/rgb.c b/rgb.c
index b264c5a62400b071e16d08b2353ee881ad0c99c3..8941a5017d8b6db811cc7001ec12f8f187646eb8 100644 (file)
--- a/rgb.c
+++ b/rgb.c
@@ -1,5 +1,4 @@
 #include "image.h"
 #include "image.h"
-#include "io.h"
 #include "log.h"
 #include "iolayer.h"
 
 #include "log.h"
 #include "iolayer.h"
 
diff --git a/tga.c b/tga.c
index 15d6c0c44ad5b535ed109405a23662d816b3f242..04f684c8065f1e39f18ae3b673b45a8c40b4bbee 100644 (file)
--- a/tga.c
+++ b/tga.c
@@ -1,5 +1,4 @@
 #include "image.h"
 #include "image.h"
-#include "io.h"
 #include "log.h"
 #include "iolayer.h"
 
 #include "log.h"
 #include "iolayer.h"