2

I open a multipage TIFF file using FreeImage and lock a specific page. After that, I use the following code to change the image resolution of the page:

FreeImage.SetResolutionX(page, (uint)outputDpi);
FreeImage.SetResolutionY(page, (uint)outputDpi);

After this, I want to export the page as a JPEG like this:

FreeImage.SaveEx(ref page, outputPath, FREE_IMAGE_FORMAT.FIF_JPEG, FREE_IMAGE_SAVE_FLAGS.TIFF_JPEG, depth, false);

But, after this, I always have a 72x72 resolution in the saved file. What am I missing?

Alexandru Pupsa
  • 1,798
  • 4
  • 21
  • 40

1 Answers1

2

i'm using the next code for saving:

FreeImage.SetResolutionX(forSaving, (uint)dpiValue);
FreeImage.SetResolutionY(forSaving, (uint)dpiValue);
FREE_IMAGE_SAVE_FLAGS compression = getJpegQuality(quality);
FreeImage.Save(FREE_IMAGE_FORMAT.FIF_JPEG, forSaving, filename, compression);

And everything is OK.

Try Save instead of SaveEx.

xZ6a33YaYEfmv
  • 1,816
  • 4
  • 24
  • 43