* [gentoo-commits] gentoo-x86 commit in media-gfx/pngtools/files: pngtools-0.4-libpng15-fixes.patch
@ 2011-09-15 18:22 Robin H. Johnson (robbat2)
0 siblings, 0 replies; 2+ messages in thread
From: Robin H. Johnson (robbat2) @ 2011-09-15 18:22 UTC (permalink / raw
To: gentoo-commits
robbat2 11/09/15 18:22:37
Added: pngtools-0.4-libpng15-fixes.patch
Log:
Bug #378169: fixes for libpng15.
(Portage version: 2.2.0_alpha51/cvs/Linux x86_64)
Revision Changes Path
1.1 media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch?rev=1.1&content-type=text/plain
Index: pngtools-0.4-libpng15-fixes.patch
===================================================================
--- pngtools-0.4.orig/pnginfo.c 2008-11-27 01:14:17.000000000 +0200
+++ pngtools-0.4.orig/pnginfo.c 2011-09-15 14:30:36.000000000 +0300
@@ -187,18 +187,21 @@
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", png_get_channels(png, info));
+ printf (" Pixel Depth: %d\n", info->pixel_depth); // 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", png_get_channels(png, info));
+ printf (" Pixel depth (Pixel Depth): %d\n", info->pixel_depth); // Does this add value?
}
// Photometric interp packs a lot of information
printf (" Colour Type (Photometric Interpretation): ");
+ int num_palette;
+ int num_trans;
+
switch (colourtype)
{
case PNG_COLOR_TYPE_GRAY:
@@ -207,10 +210,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 +235,7 @@
printf ("\n");
printf (" Image filter: ");
- switch (info->filter_type)
+ switch (png_get_filter_type(png, info))
{
case PNG_FILTER_TYPE_BASE:
printf ("Single row per byte filter ");
@@ -249,7 +252,7 @@
printf ("\n");
printf (" Interlacing: ");
- switch (info->interlace_type)
+ switch (png_get_interlace_type(png, info))
{
case PNG_INTERLACE_NONE:
printf ("No interlacing ");
@@ -266,7 +269,7 @@
printf ("\n");
printf (" Compression Scheme: ");
- switch (info->compression_type)
+ switch (png_get_compression_type(png, info))
{
case PNG_COMPRESSION_TYPE_BASE:
printf ("Deflate method 8, 32k window");
@@ -278,9 +281,13 @@
}
printf ("\n");
+ png_uint_32 x_pixels_per_unit, y_pixels_per_unit;
+ int phys_unit_type;
+ png_get_pHYs (png, info, &x_pixels_per_unit, &y_pixels_per_unit, &phys_unit_type);
+
printf (" Resolution: %d, %d ",
- info->x_pixels_per_unit, info->y_pixels_per_unit);
- switch (info->phys_unit_type)
+ x_pixels_per_unit, y_pixels_per_unit);
+ switch (phys_unit_type)
{
case PNG_RESOLUTION_UNKNOWN:
printf ("(unit unknown)");
@@ -299,15 +306,18 @@
// FillOrder is always msb-to-lsb, big endian
printf (" FillOrder: msb-to-lsb\n Byte Order: Network (Big Endian)\n");
+ png_textp text;
+ int num_text, max_text;
+
// Text comments
printf (" Number of text strings: %d of %d\n",
- info->num_text, info->max_text);
+ num_text, max_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[i].key);
- switch (info->text[1].compression)
+ switch (text[1].compression)
{
case -1:
printf ("(tEXt uncompressed)");
@@ -332,12 +342,12 @@
printf (": ");
j = 0;
- while (info->text[i].text[j] != '\0')
+ while (text[i].text[j] != '\0')
{
- if (info->text[i].text[j] == '\n')
+ if (text[i].text[j] == '\n')
printf ("\\n");
else
- fputc (info->text[i].text[j], stdout);
+ fputc (text[i].text[j], stdout);
j++;
}
@@ -385,14 +395,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);
+ png_get_channels(png, info) * bytespersample, png_get_channels(png, info), 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 / png_get_channels(png, info); i += png_get_channels(png, info) * bytespersample)
{
int scount, bcount, pixel;
@@ -408,16 +418,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 < png_get_channels(png, info); 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 < png_get_channels(png, info); scount++){
for(bcount = 0; bcount < bytespersample; bcount++) printf("00");
- if(scount != info->channels - 1) printf(" ");
+ if(scount != png_get_channels(png, info) - 1) printf(" ");
}
printf ("] ");
runlen++;
@@ -425,10 +435,10 @@
if (runlen == 0){
printf ("[");
- for(scount = 0; scount < info->channels; scount++){
+ for(scount = 0; scount < png_get_channels(png, info); scount++){
for(bcount = 0; bcount < bytespersample; bcount++)
printf("%02x", (unsigned char) bitmap[i + scount * bytespersample + bcount]);
- if(scount != info->channels - 1) printf(" ");
+ if(scount != png_get_channels(png, info) - 1) printf(" ");
}
printf("] ");
}
--- pngtools-0.4.orig/pngread.c 2008-11-27 01:14:17.000000000 +0200
+++ pngtools-0.4.orig/pngread.c 2011-09-15 14:27:37.000000000 +0300
@@ -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){
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo-x86 commit in media-gfx/pngtools/files: pngtools-0.4-libpng15-fixes.patch
@ 2011-09-16 7:12 Robin H. Johnson (robbat2)
0 siblings, 0 replies; 2+ messages in thread
From: Robin H. Johnson (robbat2) @ 2011-09-16 7:12 UTC (permalink / raw
To: gentoo-commits
robbat2 11/09/16 07:12:48
Modified: pngtools-0.4-libpng15-fixes.patch
Log:
Bug #378169 again, missed on more case with libpng15, revbump to ensure all users get the rebuilt version.
(Portage version: 2.2.0_alpha51/cvs/Linux x86_64)
Revision Changes Path
1.2 media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch?r1=1.1&r2=1.2
Index: pngtools-0.4-libpng15-fixes.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -p -w -b -B -u -u -r1.1 -r1.2
--- pngtools-0.4-libpng15-fixes.patch 15 Sep 2011 18:22:37 -0000 1.1
+++ pngtools-0.4-libpng15-fixes.patch 16 Sep 2011 07:12:47 -0000 1.2
@@ -1,20 +1,25 @@
---- pngtools-0.4.orig/pnginfo.c 2008-11-27 01:14:17.000000000 +0200
-+++ pngtools-0.4.orig/pnginfo.c 2011-09-15 14:30:36.000000000 +0300
-@@ -187,18 +187,21 @@
+diff -Nuar --exclude '*.orig' --exclude '*.rej' pngtools-0.4.orig//pnginfo.c pngtools-0.4/pnginfo.c
+--- pngtools-0.4.orig//pnginfo.c 2011-09-16 07:05:05.235477249 +0000
++++ pngtools-0.4/pnginfo.c 2011-09-16 07:07:52.385872705 +0000
+@@ -185,20 +185,25 @@
+ ///////////////////////////////////////////////////////////////////////////
+
printf (" Image Width: %d Image Length: %d\n", width, height);
++ int pixel_depth;
++ pixel_depth = bitdepth * png_get_channels(png, info);
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", png_get_channels(png, info));
-+ printf (" Pixel Depth: %d\n", info->pixel_depth); // Does this add value?
++ printf (" Pixel Depth: %d\n", pixel_depth); // 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", png_get_channels(png, info));
-+ printf (" Pixel depth (Pixel Depth): %d\n", info->pixel_depth); // Does this add value?
++ printf (" Pixel depth (Pixel Depth): %d\n", pixel_depth); // Does this add value?
}
// Photometric interp packs a lot of information
@@ -26,7 +31,7 @@
switch (colourtype)
{
case PNG_COLOR_TYPE_GRAY:
-@@ -207,10 +210,10 @@
+@@ -207,10 +212,10 @@
case PNG_COLOR_TYPE_PALETTE:
printf ("PALETTED COLOUR ");
@@ -39,7 +44,7 @@
break;
case PNG_COLOR_TYPE_RGB:
-@@ -232,7 +235,7 @@
+@@ -232,7 +237,7 @@
printf ("\n");
printf (" Image filter: ");
@@ -48,7 +53,7 @@
{
case PNG_FILTER_TYPE_BASE:
printf ("Single row per byte filter ");
-@@ -249,7 +252,7 @@
+@@ -249,7 +254,7 @@
printf ("\n");
printf (" Interlacing: ");
@@ -57,7 +62,7 @@
{
case PNG_INTERLACE_NONE:
printf ("No interlacing ");
-@@ -266,7 +269,7 @@
+@@ -266,7 +271,7 @@
printf ("\n");
printf (" Compression Scheme: ");
@@ -66,7 +71,7 @@
{
case PNG_COMPRESSION_TYPE_BASE:
printf ("Deflate method 8, 32k window");
-@@ -278,9 +281,13 @@
+@@ -278,9 +283,13 @@
}
printf ("\n");
@@ -82,7 +87,7 @@
{
case PNG_RESOLUTION_UNKNOWN:
printf ("(unit unknown)");
-@@ -299,15 +306,18 @@
+@@ -299,15 +308,18 @@
// FillOrder is always msb-to-lsb, big endian
printf (" FillOrder: msb-to-lsb\n Byte Order: Network (Big Endian)\n");
@@ -105,7 +110,7 @@
{
case -1:
printf ("(tEXt uncompressed)");
-@@ -332,12 +342,12 @@
+@@ -332,12 +344,12 @@
printf (": ");
j = 0;
@@ -121,7 +126,7 @@
j++;
}
-@@ -385,14 +395,14 @@
+@@ -385,14 +397,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",
@@ -138,7 +143,7 @@
{
int scount, bcount, pixel;
-@@ -408,16 +418,16 @@
+@@ -408,16 +420,16 @@
// Determine if this is a pixel whose entire value is zero
pixel = 0;
@@ -158,7 +163,7 @@
}
printf ("] ");
runlen++;
-@@ -425,10 +435,10 @@
+@@ -425,10 +437,10 @@
if (runlen == 0){
printf ("[");
@@ -171,8 +176,9 @@
}
printf("] ");
}
---- pngtools-0.4.orig/pngread.c 2008-11-27 01:14:17.000000000 +0200
-+++ pngtools-0.4.orig/pngread.c 2011-09-15 14:27:37.000000000 +0300
+diff -Nuar --exclude '*.orig' --exclude '*.rej' pngtools-0.4.orig//pngread.c pngtools-0.4/pngread.c
+--- pngtools-0.4.orig//pngread.c 2011-09-16 07:05:05.235477249 +0000
++++ pngtools-0.4/pngread.c 2011-09-16 07:05:44.865570870 +0000
@@ -68,7 +68,7 @@
// palette is correctly reported...
//png_set_strip_alpha (png);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-16 7:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-16 7:12 [gentoo-commits] gentoo-x86 commit in media-gfx/pngtools/files: pngtools-0.4-libpng15-fixes.patch Robin H. Johnson (robbat2)
-- strict thread matches above, loose matches on Subject: below --
2011-09-15 18:22 Robin H. Johnson (robbat2)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox