Tim, Darrell,
Digikam had been fixed once before for libpng15 issues. The patch (digikam-libpng15+gcc47_1.diff) contained:
diff -uNrb digikam.orig/digikam/kioslave/digikamthumbnail.cpp digikam/digikam/kioslave/digikamthumbnail.cpp --- digikam.orig/digikam/kioslave/digikamthumbnail.cpp 2012-04-19 07:02:43.000000000 -0500 +++ digikam/digikam/kioslave/digikamthumbnail.cpp 2012-04-19 16:44:10.307517462 -0500 @@ -413,16 +413,16 @@ if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_expand(png_ptr);
- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) has_alpha = 1;
- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { has_alpha = 1; has_grey = 1; }
- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY) + if (color_type == PNG_COLOR_TYPE_GRAY) has_grey = 1;
unsigned char **lines;
The first part of the patch is in the GIT tree, however, it looks like the second part of the patch was either lost or not applied because the code still contains:
if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) has_alpha = 1;
if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { has_alpha = 1; has_grey = 1; }
if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY) has_grey = 1;
unsigned char **lines;
The error I'm seeing is:
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:741: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:741: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: /usr/include/png.h:741:16: error: forward declaration of 'png_info {aka struct png_info_def}'
You can simply apply the patch with the sed call:
sed -i '/info_ptr->color_type/s|info_ptr->color_type|color_type|' ${srcdir}/digikam/digikam/kioslave/digikamthumbnail.cpp
Then digikam builds against libpng15:
Finished making: tde-digikam 14.0.0_dev-1 (Tue Jun 26 19:03:33 UTC 2012)
Tim, Darrell,
Digikam had been fixed once before for libpng15 issues. The patch (digikam-libpng15+gcc47_1.diff) contained:
<snip>
I wonder how that happened. Fixed in GIT hash 18ecd51.
Tim
On 06/26/2012 05:32 PM, Timothy Pearson wrote:
<snip>
I wonder how that happened. Fixed in GIT hash 18ecd51.
Tim
Gremlins.... If that is the only place they appear -- we are lucky :)
I wonder how that happened. Fixed in GIT hash 18ecd51.
Gremlins.... If that is the only place they appear -- we are lucky :)
As this is a patch to remedy building against libpng 1.5, why are preprocessor checks not needed with this patch?
While the Trinity servers were cut off from the world this afternoon, I built digikam against 1.4.9 with my own patch, that David tested as well against libpng 1.5:
http://humanreadable.nfshost.com/trinity/patches/digikam-libpng15.diff
I just now built digikam without failure against libpng 1.4.9 with the GIT patch, which does not have preprocessor checks.
Why did the old code compile against 1.4.9 and again compile against 1.4.9 with the patch?
Darrell
I wonder how that happened. Fixed in GIT hash 18ecd51.
Gremlins.... If that is the only place they appear -- we are lucky :)
David,
Did you test this patch too, as opposed to the patch I created? I don't have libpng 1.5 to test against.
(I'm confused why the preprocessor checks were not needed.)
Darrell
I wonder how that happened. Fixed in GIT hash 18ecd51.
Gremlins.... If that is the only place they appear -- we are lucky :)
David,
Did you test this patch too, as opposed to the patch I created? I don't have libpng 1.5 to test against.
(I'm confused why the preprocessor checks were not needed.)
They are not needed because the original code in Digikam was redundant. The patch simply removed the redundancy!
Tim
(I'm confused why the preprocessor checks were not needed.)
They are not needed because the original code in Digikam was redundant. The patch simply removed the redundancy!
Ok. You're dealing with a C++ dunce here, remember? I still don't grasp pointers, ->, this, and other C++ related weirdness.
Because both David and I built digikam against libpng 1.5 and 1.4.9 respectively, with the preprocessor check patch, apparently the checks did not cause any harm but are unnecessary.
I guess nice try but I'm still a C++ dunce. :-)
Darrell
(I'm confused why the preprocessor checks were not needed.)
They are not needed because the original code in Digikam was redundant. The patch simply removed the redundancy!
Ok. You're dealing with a C++ dunce here, remember? I still don't grasp pointers, ->, this, and other C++ related weirdness.
Because both David and I built digikam against libpng 1.5 and 1.4.9 respectively, with the preprocessor check patch, apparently the checks did not cause any harm but are unnecessary.
I guess nice try but I'm still a C++ dunce. :-)
Darrell
No problem. :-) I appreciate all the work you have been putting in on this project; even if you don't fully grasp C/C++, you are still providing valuable services that the project needs.
Tim
On 06/26/2012 09:31 PM, Darrell Anderson wrote:
David,
Did you test this patch too, as opposed to the patch I created? I don't have libpng 1.5 to test against.
(I'm confused why the preprocessor checks were not needed.)
Darrell
I tested yours with the preprocessor checks. I don't know what difference they will make for building with 1.4, but they work fine with 1.5.
On 06/26/2012 02:07 PM, David C. Rankin wrote:
Tim, Darrell,
Digikam had been fixed once before for libpng15 issues. The patch (digikam-libpng15+gcc47_1.diff) contained:
diff -uNrb digikam.orig/digikam/kioslave/digikamthumbnail.cpp digikam/digikam/kioslave/digikamthumbnail.cpp --- digikam.orig/digikam/kioslave/digikamthumbnail.cpp 2012-04-19 07:02:43.000000000 -0500 +++ digikam/digikam/kioslave/digikamthumbnail.cpp 2012-04-19 16:44:10.307517462 -0500 @@ -413,16 +413,16 @@ if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_expand(png_ptr);
- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
- if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) has_alpha = 1;
- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
- if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { has_alpha = 1; has_grey = 1; }
- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
if (color_type == PNG_COLOR_TYPE_GRAY) has_grey = 1;
unsigned char **lines;
<quote> Likely slipped through the cracks and never was pushed. We need to add preprocessor directives.
Here's a proposed patch:
http://humanreadable.nfshost.com/trinity/patches/digikam-libpng15.diff
Tested here with Slackware 13.1 and Current. As I don't have libpng 1.5 installed on either system, my half of the patch test is complete. You get to test against 1.5. :-)
Upon your successful report I'll push ASAP. </quote>
Darrell,
Just finished building with the patch -- worked fine with the preprocessor directives -- push it :)