سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top