trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: April 2012

SOLVED: digikam libpng15 + gcc47 - But: 'color_type' -- Is This Correct??

From: "David C. Rankin" <drankinatty@...>
Date: Thu, 19 Apr 2012 13:40:21 -0500
All,

  I have built digikam on libpng15. There were two simple fixes for:

   if (setjmp(png_jmpbuf(png_ptr)))

  The remaining errors involved:

digikamthumbnail.cpp:416:17: error: invalid use of incomplete type 'png_info
{aka struct png_info_def}'
In file included from digikamthumbnail.cpp:96:0:
/usr/include/png.h:726:16: error: forward declaration of 'png_info {aka struct
png_info_def}'
digikamthumbnail.cpp:419:17: error: invalid use of incomplete type 'png_info
{aka struct png_info_def}'
In file included from digikamthumbnail.cpp:96:0:
/usr/include/png.h:726:16: error: forward declaration of 'png_info {aka struct
png_info_def}'
digikamthumbnail.cpp:425:17: error: invalid use of incomplete type 'png_info
{aka struct png_info_def}'
In file included from digikamthumbnail.cpp:96:0:

  The above all involved references like:

if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)

  I know the 'info_ptr->color_type' is the problem. That's wrong due to no
longer having direct access to the png struct. Looking at other patches, it
looked like I could simply do:

  if (color_type == PNG_COLOR_TYPE_RGB_ALPHA)

Since we have already made the call to:

    png_get_IHDR(png_ptr, info_ptr, (png_uint_32 *) (&w32),
                 (png_uint_32 *) (&h32), &bit_depth, &color_type,
                 &interlace_type, NULL, NULL);

color_type should already hold the color type. So is just using 'color_type'
correct?

  Digikam builds fine, but I need somebody to verify the patch. Darrell, we will
need to add preprocessor checks for the libpng version. I haven't done that yet.
The consolidated patch is attached for review.

-- 
David C. Rankin, J.D.,P.E.

Attachments: