diff -Nurd digikam-1.1.0.orig/digikam/CMakeLists.txt digikam-1.1.0/digikam/CMakeLists.txt
--- digikam-1.1.0.orig/digikam/CMakeLists.txt	2010-01-31 08:22:48.000000000 -0500
+++ digikam-1.1.0/digikam/CMakeLists.txt	2012-05-17 13:31:26.000000000 -0400
@@ -73,6 +73,7 @@
                      ${JPEG_INCLUDE_DIR}
                      ${PNG_PNG_INCLUDE_DIR}
                      ${TIFF_INCLUDE_DIR}
+                     ${LENSFUN_INCLUDE_DIR}
                    )
 
 
diff -Nurd digikam-1.1.0.orig/imageplugins/lenscorrection/CMakeLists.txt digikam-1.1.0/imageplugins/lenscorrection/CMakeLists.txt
--- digikam-1.1.0.orig/imageplugins/lenscorrection/CMakeLists.txt	2010-01-31 08:21:13.000000000 -0500
+++ digikam-1.1.0/imageplugins/lenscorrection/CMakeLists.txt	2012-05-17 13:31:26.000000000 -0400
@@ -3,6 +3,7 @@
                     distortion
                     vignetting
                     ${CMAKE_CURRENT_BINARY_DIR}/../../
+                    ${LENSFUN_INCLUDE_DIR}
                    )
 
 SET(autocorrection_SRCS autocorrection/autocorrectiontool.cpp 
diff -Nurd digikam-1.1.0.orig/libs/dimg/loaders/pngloader.cpp digikam-1.1.0/libs/dimg/loaders/pngloader.cpp
--- digikam-1.1.0.orig/libs/dimg/loaders/pngloader.cpp	2010-01-31 08:21:36.000000000 -0500
+++ digikam-1.1.0/libs/dimg/loaders/pngloader.cpp	2012-05-17 16:01:26.000000000 -0400
@@ -73,6 +73,12 @@
 namespace Digikam
 {
 
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 5
+typedef png_bytep iCCP_data;
+#else 
+typedef png_charp iCCP_data;
+#endif
+
 PNGLoader::PNGLoader(DImg* image)
          : DImgLoader(image)
 {
@@ -105,7 +111,11 @@
     unsigned char buf[PNG_BYTES_TO_CHECK];
 
     size_t membersRead = fread(buf, 1, PNG_BYTES_TO_CHECK, f);
+#if PNG_LIBPNG_VER >= 10400
+    if ((membersRead != PNG_BYTES_TO_CHECK) || png_sig_cmp(buf, 0, PNG_BYTES_TO_CHECK))
+#else
     if ((membersRead != PNG_BYTES_TO_CHECK) || !png_check_sig(buf, PNG_BYTES_TO_CHECK))
+#endif
     {
         kDebug() << "Not a PNG image file.";
         fclose(f);
@@ -165,7 +175,11 @@
     CleanupData *cleanupData = new CleanupData;
     cleanupData->setFile(f);
 
+#if PNG_LIBPNG_VER >= 10400
+    if (setjmp(png_jmpbuf(png_ptr)))
+#else
     if (setjmp(png_ptr->jmpbuf))
+#endif
     {
         kDebug() << "Internal libPNG error during reading file. Process aborted!";
         png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
@@ -322,7 +336,11 @@
 #ifdef ENABLE_DEBUG_MESSAGES
                     kDebug() << "PNG in PNG_COLOR_TYPE_GRAY";
 #endif
+#if PNG_LIBPNG_VER >= 10400
+                    png_set_expand_gray_1_2_4_to_8(png_ptr);
+#else
                     png_set_gray_1_2_4_to_8(png_ptr);
+#endif
                     png_set_gray_to_rgb(png_ptr);
 
                     if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)           // Intel
@@ -473,7 +491,8 @@
 
     if (m_loadFlags & LoadICCData)
     {
-        png_charp   profile_name, profile_data=NULL;
+        png_charp   profile_name;
+        iCCP_data   profile_data=NULL;
         png_uint_32 profile_size;
         int         compression_type;
 
@@ -627,7 +646,11 @@
     CleanupData *cleanupData = new CleanupData;
     cleanupData->setFile(f);
 
-    if (setjmp(png_ptr->jmpbuf))
+#if PNG_LIBPNG_VER >= 10400
+    if (setjmp(png_jmpbuf(png_ptr)))
+#else
+     if (setjmp(png_ptr->jmpbuf))
+#endif
     {
         kDebug() << "Internal libPNG error during writing file. Process aborted!";
         png_destroy_write_struct(&png_ptr, (png_infopp) & info_ptr);
@@ -705,7 +728,7 @@
 
     if (!profile_rawdata.isEmpty())
     {
-        png_set_iCCP(png_ptr, info_ptr, (png_charp)("icc"), PNG_COMPRESSION_TYPE_BASE, profile_rawdata.data(), profile_rawdata.size());
+        png_set_iCCP(png_ptr, info_ptr, (png_charp)("icc"), PNG_COMPRESSION_TYPE_BASE, (iCCP_data)profile_rawdata.data(), profile_rawdata.size());
     }
 
     // -------------------------------------------------------------------
diff -Nurd digikam-1.1.0.orig/libs/threadimageio/thumbnailbasic.cpp digikam-1.1.0/libs/threadimageio/thumbnailbasic.cpp
--- digikam-1.1.0.orig/libs/threadimageio/thumbnailbasic.cpp	2010-01-31 08:21:53.000000000 -0500
+++ digikam-1.1.0/libs/threadimageio/thumbnailbasic.cpp	2012-05-17 19:48:51.000000000 -0400
@@ -137,7 +137,11 @@
     unsigned char buf[PNG_BYTES_TO_CHECK];
 
     size_t itemsRead = fread(buf, 1, PNG_BYTES_TO_CHECK, f);
+#if PNG_LIBPNG_VER >= 10400
+    if (itemsRead != 1 || png_sig_cmp(buf, 0, PNG_BYTES_TO_CHECK))
+#else
     if (itemsRead != 1 || !png_check_sig(buf, PNG_BYTES_TO_CHECK))
+#endif
     {
         fclose(f);
         return qimage;
