Bug 117225

Summary: digikam requires at least libpng >= 1.2.7
Product: [Applications] digikam Reporter: alfons.hoogervorst
Component: Plugin-DImg-PNGAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: rdieter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 0.9.0
Sentry Crash Report:
Attachments: Require a png version that has png_set_add_alpha

Description alfons.hoogervorst 2005-11-28 19:57:10 UTC
Version:           CVS (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.3.1 compiled from sources
OS:                Linux

Hiya,

Latest digiKam from svn didn't build on my system, with libpng 1.2.5. Since recently digiKam uses png_set_add_alpha(), which was introduced in libpng 1.2.7 (cursory glance at the png changelog). 
The attached patch fixes it in a straight forward way by telling the compiler to use a newer libpng.
Comment 1 alfons.hoogervorst 2005-11-28 19:58:17 UTC
Created attachment 13666 [details]
Require a png version that has png_set_add_alpha
Comment 2 caulier.gilles 2005-11-28 22:51:16 UTC
SVN commit 483962 by cgilles:

patch from alfons hoogervorst: digikam 0.9.0 requires at least libpng >= 1.2.7

CCBUG: 117225

 M  +10 -0     configure.in.bot  
 M  +15 -0     configure.in.in  


--- trunk/extragear/graphics/digikam/configure.in.bot #483961:483962
@@ -72,6 +72,16 @@
   echo "-- libtiff found.................. YES"
 fi
 
+if test "x$have_png" != "xyes"; then
+  echo "-- libpng found................... NO"
+  echo ""
+  echo "digiKam needs libpng. You need to install the correct version (>= 1.2.7)."
+  echo ""
+  all_tests=bad
+else
+  echo "-- libpng found................... YES"
+fi
+
 if test "x$have_lcms" != "xyes"; then
   echo "-- lcms found..................... NO"
   echo ""
--- trunk/extragear/graphics/digikam/configure.in.in #483961:483962
@@ -251,6 +251,21 @@
 fi
 
 #------------------------------------------------------------------
+# Check for libpng with png_set_add_alpha() function
+#------------------------------------------------------------------
+
+have_png=no
+KDE_CHECK_LIB(png, png_set_add_alpha,
+        have_png=yes,
+        AC_MSG_WARN([digiKam requires libpng >= 1.2.7]),
+        -lpng -lz -lm)
+
+if test "x$have_png" != "xyes"; then
+  AC_WARN([digiKam requires libpng >= 1.2.7; digiKam will not be compiled.])
+  DO_NOT_COMPILE="digikam digikamimageplugins $DO_NOT_COMPILE"
+fi  
+
+#------------------------------------------------------------------
 # Check for lcms (backported from krita)
 #------------------------------------------------------------------
 
Comment 3 caulier.gilles 2005-11-28 22:58:35 UTC
Thanks for this patch Alfons.
Gilles
Comment 4 Rex Dieter 2005-11-29 17:32:43 UTC
Would it be possible to make the alpha support, ie, the calls to png_set_add_alpha() that require libpng >= 1.2.7, optional?  Else, you'll be locking out a lot of users (of older distributions).
Comment 5 caulier.gilles 2005-11-29 18:24:49 UTC
perhaps if i have more time because i'm very busy with digiKam core actually.

If anyone can provide a patch...

Gilles Caulier
Comment 6 Rex Dieter 2005-11-29 18:30:00 UTC
Wouldn't it be as easy as replacing every
png_set_add_alpha()

with something like:
#if (PNG_LIBPNG_VER_MAJOR >= 1 ) && (PNG_LIBPNG_VER_MINOR >= 2) && (PNG_LIBPNG_VER_RELEASE >= 7)
png_set_add_alpha()
#endif


#define PNG_LIBPNG_VER_MAJOR   1
#define PNG_LIBPNG_VER_MINOR   2
#define PNG_LIBPNG_VER_RELEASE 8
Comment 7 caulier.gilles 2005-11-29 18:34:55 UTC
Well, it's easy to make patch (:=))) I'm busy on other digiKam part...

Gilles