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

  • Home
  • SEARCH
  • 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 8886861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:39:42+00:00 2026-06-14T21:39:42+00:00

I’ve got a multipage tiff using jpeg compression. When opening the file via libtiff.net

  • 0

I’ve got a multipage tiff using jpeg compression.

When opening the file via libtiff.net I get following error message:

JPEGPreDecode: 
JPEG strip/tile size exceeds expected dimensions, expected 1164x1, got 1164x826.

The image processing fails.
The file/directory has this tags:

OldSubFileType (1 Short): 1
ImageWidth (1 Long): 1164
ImageLength (1 Long): 826
BitsPerSample (3 Short): 8, 8, 8
Compression (1 Short): JPEG Technote #2
Photometric (1 Short): YCbCr
FillOrder (1 Short): Msb2Lsb
StripOffsets (1 Long): 224
SamplesPerPixel (1 Short): 3
StripByteCounts (1 Long): 109294
XResolution (1 Rational): 200
YResolution (1 Rational): 200
PlanarConfig (1 Short): Contig

With other jpeg compressed files I’ve no problems.
Any ideas why I get the error? Why does it expect 1164×1?

  • 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-06-14T21:39:43+00:00Added an answer on June 14, 2026 at 9:39 pm

    Please make sure your files have ROWSPERSTRIP tag set.

    Without this tag set, JPEG decoder might assume that height of strips in your image is incorrect.

    Other option is to download source code of LibTiff.Net, set breakpoint at the beginning of JPEGPreDecode method in JpgeCodec.cs and see what goes wrong. Most probably, the following part of the method is causing the warnings and misbehaving of the codec:

    if (segment_height > td.td_rowsperstrip)
        segment_height = td.td_rowsperstrip;
    

    You might change this part of the method but it might be better to fix the files instead.

    You might also try to add the tag yourselves (please note that you will need to set tag for each directory). Open the image, check the presence of the tag and try setting the correct value for the tag using ‘SetField’ method.

    using (Tiff image = Tiff.Open(existingTiffName, "a"))
    {
        for (int i = 0; i < image.NumberOfDirectories(); i++)
        {
            image.SetDirectory(i);
            ...
    
            FieldValue[] value = image.GetField(TiffTag.ROWSPERSTRIP);
            if (value == null)
            {
                // ROWSPERSTRIP is not set
                image.SetField(TiffTag.ROWSPERSTRIP, heightOfTheImage);
            }
            ...
        }
    }
    

    Please note that you should open image in append more (use "a" parameter for this).

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

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I've got a string that has curly quotes in it. I'd like to replace

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.