0

We have some TIFF files and we want to convert it to JPEG. We try to use FreeImageNET wrapper to FreeImage library. In C# we have code:

dib = FreeImage.Load(FREE_IMAGE_FORMAT.FIF_TIFF, path, FREE_IMAGE_LOAD_FLAGS.DEFAULT);

TIFF image load Ok, no errors here. But if we want to save image by code:

FreeImage.Save(FREE_IMAGE_FORMAT.FIF_JPEG, dib, Path.Combine(newPathForSave, fsh.GetNextFileName() + ".jpeg"), FREE_IMAGE_SAVE_FLAGS.DEFAULT);

No errors here but jpeg file size is zero. Why ?

1 Answers1

0

why don't you try changing the Flag of the JPEG to something like FREE_IMAGE_SAVE_FLAGS.JPEG_QUALITYGOOD

Check the library documentation: SAVE_FLAGS

I am using the same library to save a bmp as a TIFF and is the only thing I can see from my code that is different.

clopezm
  • 89
  • 1
  • 8