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 3793436
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:46:32+00:00 2026-05-19T12:46:32+00:00

My application has to handle TIFF files that are stored in a MemoryStream, but

  • 0

My application has to handle TIFF files that are stored in a MemoryStream, but LibTiff.Net always returns null for the field values.

        MemoryStream ms = new MemoryStream();
        FileStream fs = new FileStream("testfile.tif", FileMode.Open);
        fs.CopyTo(ms);

        //It seems (memory) streams have to be opened in write mode, "r" always returns <null>
        Tiff tiff = Tiff.ClientOpen("someArbitraryName", "w", ms, new TiffStream());

        FieldValue[] imageHeight = tif.GetField(TiffTag.IMAGELENGTH);

Opening the file directly for reading using Tiff.Open works fine.

Is this a bug in the LibTiff.Net library or am I missing something?

  • 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-19T12:46:32+00:00Added an answer on May 19, 2026 at 12:46 pm

    Bit Miracle support team provided me with the solution:

    Tiff.ClientOpen reads data from the current position of the stream.

        MemoryStream ms = new MemoryStream();
        FileStream fs = new FileStream("testfile.tif", FileMode.Open);
        fs.CopyTo(ms);
    
        ms.Position = 0;
    
        Tiff tiff = Tiff.ClientOpen("someArbitraryName", "r", ms, new TiffStream());
    
        FieldValue[] imageHeight = tif.GetField(TiffTag.IMAGELENGTH);
    

    This fixes the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an application that has to handle the construction cases of a small
my application has all types of file, how i can handle to open files
I am building an application that has to handle the parsing of several different
I was under the impression that if an application has an open handle and
Our application has many controls that are created dynamically. For example, a navigation pane
My application has a table that contains snapshot inventory data from each year. For
Our application has a couple of shell scripts that are called from web-based Oracle
I have an application which has to handle a list of objects (retrieved from
My application has a requirement that we need to encrypt index fields. Right now
My ASP.NET MVC application has pages with attachments and these attachments can be of

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.