Source: pngtools
Version: 0.4-1
Severity: important
Tags: patch
User: [email protected]
Usertags: libpng15-transition
Hi,
I uploaded libpng 1.5.2 to experimental.
libpng maintainers plan to transition from libpng 1.2 to 1.5.
I am checking build it the package depend to libpng 1.5, and I noticed your
package FTBFS by libpng 1.5.
I created the patch that revise this problem.
Could you check and apply this patch?
Best regards,
Nobuhiro
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.39-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
--- pngtools-0.4.orig/pnginfo.c
+++ pngtools-0.4/pnginfo.c
@@ -136,6 +136,10 @@
unsigned long imageBufSize, width, height, runlen;
unsigned char signature;
int bitdepth, colourtype;
+ png_byte channels;
+ int interlace_type, compression_type, filter_type;
+ png_uint_32 res_x, res_y;
+ int unit_type;
png_uint_32 i, j, rowbytes;
png_structp png;
png_infop info;
@@ -177,8 +181,8 @@
png_init_io (png, image);
png_set_sig_bytes (png, 8);
png_read_info (png, info);
- png_get_IHDR (png, info, &width, &height, &bitdepth, &colourtype, NULL,
- NULL, NULL);
+ png_get_IHDR (png, info, &width, &height, &bitdepth, &colourtype, &interlace_type, &compression_type, &filter_type);
+ channels = png_get_channels(png, info);
///////////////////////////////////////////////////////////////////////////
// Start displaying information
@@ -187,15 +191,25 @@
printf (" Image Width: %d Image Length: %d\n", width, height);
if(tiffnames == pnginfo_true){
printf (" Bits/Sample: %d\n", bitdepth);
- printf (" Samples/Pixel: %d\n", info->channels);
- printf (" Pixel Depth: %d\n", info->pixel_depth); // Does this add value?
+ printf (" Samples/Pixel: %d\n", channels);
+ printf (" Pixel Depth: %d\n",channels * bitdepth); // Does this add value?
}
else{
printf (" Bitdepth (Bits/Sample): %d\n", bitdepth);
- printf (" Channels (Samples/Pixel): %d\n", info->channels);
- printf (" Pixel depth (Pixel Depth): %d\n", info->pixel_depth); // Does this add value?
+ printf (" Channels (Samples/Pixel): %d\n", channels);
+ printf (" Pixel depth (Pixel Depth): %d\n", channels * bitdepth); // Does this add value?
}
+ png_bytep trans_alpha;
+ int num_trans;
+ png_color_16p trans_color;
+ png_colorp palette;
+ int num_palette;
+
+ png_get_tRNS(png, info, &trans_alpha, &num_trans, &trans_color);
+ png_get_PLTE(png, info, &palette, &num_palette);
+ png_get_pHYs_dpi(png, info, &res_x, &res_y, &unit_type);
+
// Photometric interp packs a lot of information
printf (" Colour Type (Photometric Interpretation): ");
@@ -207,10 +221,10 @@
case PNG_COLOR_TYPE_PALETTE:
printf ("PALETTED COLOUR ");
- if (info->num_trans > 0)
+ if (num_trans > 0)
printf ("with alpha ");
printf ("(%d colours, %d transparent) ",
- info->num_palette, info->num_trans);
+ num_palette, num_trans);
break;
case PNG_COLOR_TYPE_RGB:
@@ -232,7 +246,7 @@
printf ("\n");
printf (" Image filter: ");
- switch (info->filter_type)
+ switch (filter_type)
{
case PNG_FILTER_TYPE_BASE:
printf ("Single row per byte filter ");
@@ -249,7 +263,7 @@
printf ("\n");
printf (" Interlacing: ");
- switch (info->interlace_type)
+ switch (interlace_type)
{
case PNG_INTERLACE_NONE:
printf ("No interlacing ");
@@ -266,7 +280,7 @@
printf ("\n");
printf (" Compression Scheme: ");
- switch (info->compression_type)
+ switch (compression_type)
{
case PNG_COMPRESSION_TYPE_BASE:
printf ("Deflate method 8, 32k window");
@@ -278,9 +292,8 @@
}
printf ("\n");
- printf (" Resolution: %d, %d ",
- info->x_pixels_per_unit, info->y_pixels_per_unit);
- switch (info->phys_unit_type)
+ printf (" Resolution: %d, %d ",res_x, res_y);
+ switch (unit_type)
{
case PNG_RESOLUTION_UNKNOWN:
printf ("(unit unknown)");
@@ -299,15 +312,19 @@
// FillOrder is always msb-to-lsb, big endian
printf (" FillOrder: msb-to-lsb\n Byte Order: Network (Big Endian)\n");
+ png_textp text_ptr;
+ int num_text;
+ png_get_text(png, info, &text_ptr, &num_text);
+
// Text comments
- printf (" Number of text strings: %d of %d\n",
- info->num_text, info->max_text);
+ printf (" Number of text strings: %d\n",
+ num_text);
- for (i = 0; i < info->num_text; i++)
+ for (i = 0; i < num_text; i++)
{
- printf (" %s ", info->text[i].key);
+ printf (" %s ", text_ptr[i].key);
- switch (info->text[1].compression)
+ switch (text_ptr[1].compression)
{
case -1:
printf ("(tEXt uncompressed)");
@@ -332,12 +349,12 @@
printf (": ");
j = 0;
- while (info->text[i].text[j] != '\0')
+ while (text_ptr[i].text[j] != '\0')
{
- if (info->text[i].text[j] == '\n')
+ if (text_ptr[i].text[j] == '\n')
printf ("\\n");
else
- fputc (info->text[i].text[j], stdout);
+ fputc (text_ptr[i].text[j], stdout);
j++;
}
@@ -385,14 +402,14 @@
printf ("Dumping the bitmap for this image:\n");
printf ("(Expanded samples result in %d bytes per pixel, %d channels with %d bytes per channel)\n\n",
- info->channels * bytespersample, info->channels, bytespersample);
+ channels * bytespersample, channels, bytespersample);
// runlen is used to stop us displaying repeated byte patterns over and over --
// I display them once, and then tell you how many times it occured in the file.
// This currently only applies to runs on zeros -- I should one day add an
// option to extend this to runs of other values as well
runlen = 0;
- for (i = 0; i < rowbytes * height / info->channels; i += info->channels * bytespersample)
+ for (i = 0; i < rowbytes * height / channels; i += channels * bytespersample)
{
int scount, bcount, pixel;
@@ -408,16 +425,16 @@
// Determine if this is a pixel whose entire value is zero
pixel = 0;
- for(scount = 0; scount < info->channels; scount++)
+ for(scount = 0; scount < channels; scount++)
for(bcount = 0; bcount < bytespersample; bcount++)
pixel += bitmap[i + scount * bytespersample + bcount];
if ((runlen == 0) && !pixel)
{
printf ("[");
- for(scount = 0; scount < info->channels; scount++){
+ for(scount = 0; scount < channels; scount++){
for(bcount = 0; bcount < bytespersample; bcount++) printf("00");
- if(scount != info->channels - 1) printf(" ");
+ if(scount != channels - 1) printf(" ");
}
printf ("] ");
runlen++;
@@ -425,10 +442,10 @@
if (runlen == 0){
printf ("[");
- for(scount = 0; scount < info->channels; scount++){
+ for(scount = 0; scount < channels; scount++){
for(bcount = 0; bcount < bytespersample; bcount++)
printf("%02x", (unsigned char) bitmap[i + scount * bytespersample + bcount]);
- if(scount != info->channels - 1) printf(" ");
+ if(scount != channels - 1) printf(" ");
}
printf("] ");
}
only in patch2:
unchanged:
--- pngtools-0.4.orig/Makefile.in
+++ pngtools-0.4/Makefile.in
@@ -67,7 +67,7 @@
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -lpng
SOURCES = $(pngchunkdesc_SOURCES) $(pngchunks_SOURCES) \
$(pngcp_SOURCES) $(pnginfo_SOURCES)
DIST_SOURCES = $(pngchunkdesc_SOURCES) $(pngchunks_SOURCES) \
only in patch2:
unchanged:
--- pngtools-0.4.orig/pngread.c
+++ pngtools-0.4/pngread.c
@@ -68,7 +68,7 @@
// palette is correctly reported...
//png_set_strip_alpha (png);
png_read_update_info (png, info);
- *channels = info->channels;
+ *channels = png_get_channels(png, info);
rowbytes = png_get_rowbytes (png, info);
if((row_pointers = malloc (*height * sizeof (png_bytep))) == NULL){