diff options
Diffstat (limited to 'codec/j2k_to_image.c')
| -rw-r--r-- | codec/j2k_to_image.c | 19 |
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 */ |
