summaryrefslogtreecommitdiff
path: root/codec/j2k_to_image.c
diff options
context:
space:
mode:
authorAntonin Descampe <antonin@gmail.com>2010-10-05 10:33:15 +0000
committerAntonin Descampe <antonin@gmail.com>2010-10-05 10:33:15 +0000
commiteeefefd56cb3edddefb73141733fd1e757c4b798 (patch)
tree4727958764c4c348762c043c2efbb7470a9ffcca /codec/j2k_to_image.c
parent531c0cf26f0c327b42a5caa79725e4afeb98768d (diff)
Added files to let people build openjpeg with configure tools ; Added makefiles to let people manually build openjpeg on *nix platforms ; Removed obsolete Makefiles ; Renamed dirent.h to windirent.h ; Made optional the PNG, TIFF, and LCMS support in CMake files ; Added opj_config* files to configure openjpeg before building it (opj_config.h generated by configure, cmake, or manually by the user) ; Renamed this file from ChangeLog to CHANGES ; Renamed License.txt to LICENSE ; Updated README files ; Added INSTALL and LICENSE files ; Added man pages
Diffstat (limited to 'codec/j2k_to_image.c')
-rw-r--r--codec/j2k_to_image.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/codec/j2k_to_image.c b/codec/j2k_to_image.c
index 3b1915c7..2e93fcdc 100644
--- a/codec/j2k_to_image.c
+++ b/codec/j2k_to_image.c
@@ -29,6 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <opj_config.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -37,7 +38,11 @@
#include "openjpeg.h"
#include "compat/getopt.h"
#include "convert.h"
-#include "dirent.h"
+#ifdef WIN32
+#include "windirent.h"
+#else
+#include <dirent.h>
+#endif /* WIN32 */
#include "index.h"
#ifndef WIN32
@@ -764,7 +769,7 @@ int main(int argc, char **argv) {
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
}
break;
-
+#ifdef HAVE_LIBTIFF
case TIF_DFMT: /* TIFF */
if(imagetotif(image, parameters.outfile)){
fprintf(stdout,"Outfile %s not generated\n",parameters.outfile);
@@ -773,7 +778,7 @@ int main(int argc, char **argv) {
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
}
break;
-
+#endif /* HAVE_LIBTIFF */
case RAW_DFMT: /* RAW */
if(imagetoraw(image, parameters.outfile)){
fprintf(stdout,"Error generating raw file. Outfile %s not generated\n",parameters.outfile);
@@ -791,7 +796,7 @@ int main(int argc, char **argv) {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
}
break;
-
+#ifdef HAVE_LIBPNG
case PNG_DFMT: /* PNG */
if(imagetopng(image, parameters.outfile)){
fprintf(stdout,"Error generating png file. Outfile %s not generated\n",parameters.outfile);
@@ -800,6 +805,12 @@ int main(int argc, char **argv) {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
}
break;
+#endif /* HAVE_LIBPNG */
+/* Can happen if output file is TIFF or PNG
+ * and HAVE_LIBTIF or HAVE_LIBPNG is undefined
+*/
+ default:
+ fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
}
/* free remaining structures */