On Wed, 24 Aug 2016 02:06:45 -0700 (PDT), Tomas Dvorak wrote:
>Now when I put command:
> opj_compress -i image.tif -o image.jp2
>
>I get the message:
>Unable to load file: got no image
>
>But there is the image.tif in the directory.
opj_compress.c, line 1782:
/* Can happen if input file is TIFF or PNG
* and OPJ_HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
*/
if( !image) {
fprintf(stderr, "Unable to load file: got no image\n");
return 1;
}
So, I suppose you do not have the TIFF library installed. Or CMAKE
can not find it. cmake-3.5 uses the file:
/usr/share/cmake-3.5/Modules/FindTIFF.cmake
This could be the contents of an opj-cmake.sh:
----------------------------------------
#!/bin/sh
cmake -DBUILD_DOC:bool=on -DBUILD_PKGCONFIG_FILES:bool=on \
-DCMAKE_BUILD_TYPE:string="Release" -DBUILD_VIEWER:bool=off \
-DBUILD_JAVA:bool=off \
-DBUILD_JPIP_SERVER:bool=off -DBUILD_JPIP:bool=off \
-DBUILD_SHARED_LIBS:bool=on -DBUILD_MJ2:bool=on \
-DBUILD_JP3D:bool=on -DBUILD_JPWL:bool=on \
-DBUILD_THIRDPARTY:bool=on ..
---------------------------------------
Copy this shell script to the subdirectory BUILD:
cp opj-cmake.sh openjpeg-2.1.1
cd openjpeg-2.1.1
mkdir BUILD
cd BUILD
cp ../opj-cmake.sh .
./opj-cmake-sh
Then, if the compilation succeeds, try:
bin/opj_compress -i image.tif -o image.jp2
If you have installed the TIFF library, you can add in opj-cmake.sh:
-DTIFF_INCLUDE_DIR:path="path/to/include/"
where the files
tiff.h tiffconf.h tiffio.h tiffio.hxx tiffvers.h
are installed. And do not forget to change '-DBUILD_THIRDPARTY:bool=on'
to '-DBUILD_THIRDPARTY:bool=off'.
winfried