summaryrefslogtreecommitdiff
path: root/codec
diff options
context:
space:
mode:
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;