Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7566845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:30:56+00:00 2026-05-30T14:30:56+00:00

I use FreeImage to work with multipage TIFF files and at some point I

  • 0

I use FreeImage to work with multipage TIFF files and at some point I have a TIFF page, in a FIBITMAP and I need to know its compression. Any idea how to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:30:57+00:00Added an answer on May 30, 2026 at 2:30 pm

    FreeImage has no built in function to reveal the tiff file compression scheme, however you can use Exif metadata to figure that out (dib is local FIBITMAP variable, this is c# code):

        public string GetCompressionName()
        {
            long _compression;
    
            if (dib.IsNull)
               throw new Exception("dib is empty - image haven't been loaded!");
    
            //Searching tag in metadata.
            ImageMetadata iMetadata = new ImageMetadata(dib);
    
            foreach (MetadataModel metadataModel in iMetadata)
            {
                if (metadataModel.ToString() == "FIMD_EXIF_MAIN")
                {
                    try
                    { long.TryParse(metadataModel.GetTag("Compression").ToString(), out _compression); }
                    catch
                    { return "Unknown"; }
    
    
                    if (CompressType.ContainsKey(_compression))
                    {
                        string _compressionName;
                        CompressType.TryGetValue(_compression, out _compressionName);
    
                        if (_compressionName != null)
                        {
                            return _compressionName;
                        }
                    }
                }
            }
    
            return "Unknown";
        }
    
    Dictionary<long, string> CompressType = new Dictionary<long, string>()
            { 
                {1, "Uncompressed" } ,
                {2, "CCITT modified Huffman RLE"},
                {32773, "PackBits"}, 
                {3, "CCITT3"},
                {4, "CCITT4"},
                {5, "LZW"},
                {6, "JPEG_old"},
                {7, "JPEG_new"},
                {32946, "DeflatePKZIP"},
                {8, "DeflateAdobe"},
                {9, "JBIG_85"},
                {10, "JBIG_43"},
                {11, "JPEG"},
                {12, "JPEG"},
                {32766, "RLE_NeXT"},
                {32809, "RLE_ThunderScan"},
                {32895, "RasterPadding"},
                {32896, "RLE_LW"},
                {32897, "RLE_HC"},
                {32947, "RLE_BL"},
                {34661, "JBIG"},
                {34713, "Nikon_NEF"},
                {34712,"JPEG2000"}
            };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this situation where I need to display a bunch of files pulled
Use case: user clicks the link on a webpage - boom! load of files
Use case: I've just entered insert mode, and typed some text. Now I want
Use case: class MyTask(Task): queue = 'default_queue' def run(self): # do work Normally I
I have to use glDrawPixels to implement a raster algorithm. Right now I'm only
I have written a small application which will be used in my work environment
I have a png image file with alpha blending of its own. Now I
I have a problem with image scaling in .NET. I use the standard Graphics
I want to know how does the code below work to do because I
I have some code here private void Run() { MyClass c = new MyClass();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.