summaryrefslogtreecommitdiff
path: root/codec
diff options
context:
space:
mode:
authorAntonin Descampe <antonin@gmail.com>2011-03-20 22:45:24 +0000
committerAntonin Descampe <antonin@gmail.com>2011-03-20 22:45:24 +0000
commit19f9147e1076d83dd1111609ca93a01085dbfb4f (patch)
tree8ba9fe2ac562b474f627c3ae8c90eefb7d0435a3 /codec
parent6bda73eeb2134963f64c3d67fdd11c1304cb14f9 (diff)
Removed the libs directory containing win32 compiled versions of libpng, libtiff and liblcms. Added a thirdparty directory to include main source files of libtiff, libpng, libz and liblcms to enable support of these formats in the codec executables. CMake will try to statically build these libraries if they are not found on the system. Note that these third party libraries are not required to build libopenjpeg (which has no dependencies).
Diffstat (limited to 'codec')
-rw-r--r--codec/CMakeLists.txt21
-rw-r--r--codec/convert.c11
2 files changed, 9 insertions, 23 deletions
diff --git a/codec/CMakeLists.txt b/codec/CMakeLists.txt
index 9b5b70c2..791d13b8 100644
--- a/codec/CMakeLists.txt
+++ b/codec/CMakeLists.txt
@@ -18,15 +18,12 @@ ENDIF(DONT_HAVE_GETOPT)
# Headers file are located here:
INCLUDE_DIRECTORIES(
${OPENJPEG_SOURCE_DIR}/libopenjpeg
- ${LCMS_INCLUDE_DIR}
+ ${LCMS_INCLUDE_DIRNAME}
${OPENJPEG_SOURCE_DIR}/common
+ ${Z_INCLUDE_DIRNAME}
+ ${PNG_INCLUDE_DIRNAME}
+ ${TIFF_INCLUDE_DIRNAME}
)
-IF(PNG_FOUND)
- INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
-ENDIF(PNG_FOUND)
-IF(TIFF_FOUND)
- INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
-ENDIF(TIFF_FOUND)
IF(WIN32)
IF(BUILD_SHARED_LIBS)
@@ -39,13 +36,9 @@ ENDIF(WIN32)
# Loop over all executables:
FOREACH(exe j2k_to_image image_to_j2k j2k_dump)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
- TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME} ${LCMS_LIB})
- IF(PNG_FOUND)
- TARGET_LINK_LIBRARIES(${exe} ${PNG_LIBRARIES})
- ENDIF(PNG_FOUND)
- IF(TIFF_FOUND)
- TARGET_LINK_LIBRARIES(${exe} ${TIFF_LIBRARIES})
- ENDIF(TIFF_FOUND)
+ TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME}
+ ${LCMS_LIBNAME} ${Z_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
+
ADD_TEST(${exe} ${EXECUTABLE_OUTPUT_PATH}/${exe})
# calling those exe without option will make them fail always:
SET_TESTS_PROPERTIES(${exe} PROPERTIES WILL_FAIL TRUE)
diff --git a/codec/convert.c b/codec/convert.c
index 088a5c58..47c29931 100644
--- a/codec/convert.c
+++ b/codec/convert.c
@@ -44,19 +44,12 @@
#endif
#ifdef HAVE_LIBTIFF
-#ifdef _WIN32
-#include "../libs/libtiff/tiffio.h"
-#else
#include <tiffio.h>
-#endif /* _WIN32 */
#endif /* HAVE_LIBTIFF */
#ifdef HAVE_LIBPNG
-#ifdef _WIN32
-#include "../libs/png/png.h"
-#else
+#include <zlib.h>
#include <png.h>
-#endif /* _WIN32 */
#endif /* HAVE_LIBPNG */
#include "../libopenjpeg/openjpeg.h"
@@ -1515,7 +1508,7 @@ typedef struct tiff_infoheader{
int imagetotif(opj_image_t * image, const char *outfile) {
int width, height, imgsize;
int bps,index,adjust = 0;
- int last_i=0;
+ unsigned int last_i=0;
TIFF *tif;
tdata_t buf;
tstrip_t strip;