Version 10 vs 9 tiffs are different somehow.

Discussions about image processing and document imaging.
Post Reply
dan276
Posts: 20
Joined: Fri Mar 15, 2013 1:07 am

Version 10 vs 9 tiffs are different somehow.

Post by dan276 » Wed Apr 30, 2014 7:57 pm

So I have an old outdated 3rd party viewer that needs to view these tiffs I'm creating with GDPicture and for some reason when I changed from Version 9 to 10, this 3rd party view gives an error (The tiff looks fine, there's nothing wrong with it, just a very picky viewer).
I looked at the properties from file explorer, everything is the same, compression, bit depth...
I'm not sure why

I'm not sure how to debug it. How can I tell the differences?

Compression is CCITT T.4
Resolution is 200dpi
Bit Depth 1
Resolution unit 2

Both the same.

It's sort of strange that I use CompressionScheme = TiffCompression.TiffCompressionCCITT3;
and it comes out T.4 but I guess that's normal.

My code is below from converting a PDF to a Multipage tiff

Code: Select all

 foreach (var a in oGdPicturePDF)
            {

                for (int i = 1; i <= a.GetPageCount(); i++)
                {
                    if (Status == GdPictureStatus.OK)
                    {
                        a.SelectPage(i);
                        int RasterizedPageID = a.RenderPageToGdPictureImageEx(DPI, true);
                        if (RasterizedPageID == 0)
                        {
                            // MessageBox.Show("Error:" + oGdPicturePDF.GetStat().ToString());
                            return "Failed to Create Page ID: " + i;
                        }
                        // CCITT3 & CCITT4 compression support only bitonal (1 bpp) images !!

                        //   oGdPictureImaging.DrawText(RasterizedPageID, lfiles[tpc - 1].FileName + " Page " + i, 50, 50, 20, GdPicture9.FontStyle.FontStyleRegular,
                        //  Color.Black, "Arial", false);
                        // oGdPictureImaging.ConvertTo1Bpp(RasterizedPageID);
                        if (firstPageMulti)
                        {
                            firstPageMulti = false;
                            MultiTiffID = RasterizedPageID; // Warning: this image must be released at the end!!!!
               
                            if (CompressionScheme == TiffCompression.TiffCompressionCCITT3 | CompressionScheme == TiffCompression.TiffCompressionCCITT4)
                            {
                                oGdPictureImaging.ConvertTo1Bpp(RasterizedPageID);
                            }
                            Status = oGdPictureImaging.TiffSaveAsMultiPageFile(MultiTiffID, outputPath, CompressionScheme);

                        }
                        else
                        {

                            if (CompressionScheme == TiffCompression.TiffCompressionCCITT3 | CompressionScheme == TiffCompression.TiffCompressionCCITT4)
                            {
                                oGdPictureImaging.ConvertTo1Bpp(RasterizedPageID);
                            }
                            Status = oGdPictureImaging.TiffAddToMultiPageFile(MultiTiffID, RasterizedPageID);

                            oGdPictureImaging.ReleaseGdPictureImage(RasterizedPageID);
                        }

                    }
                  
 
                }

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: Version 10 vs 9 tiffs are different somehow.

Post by SamiKharma » Mon May 05, 2014 1:24 pm

Hi,

It is hard to tell anything without an example of the tiff image. In any case, if the tiff image is easily viewed by most viewers, then most probably the viewer you are using has limitations. Since we cannot tell what error it is returning, and even if we were able to, we cannot do anything to fix it since it is not our product.
I suggest you contact the producer of that viewer to see why they have that limitation.

Best,
Sami

dan276
Posts: 20
Joined: Fri Mar 15, 2013 1:07 am

Re: Version 10 vs 9 tiffs are different somehow.

Post by dan276 » Mon May 05, 2014 7:05 pm

Is there is a good tool you know of to view the details of the tiff?

dan276
Posts: 20
Joined: Fri Mar 15, 2013 1:07 am

Re: Version 10 vs 9 tiffs are different somehow.

Post by dan276 » Tue May 06, 2014 3:08 am

Actually I did find something that compares files. http://www.bitbanksoftware.com/tinytools.html

There are more tags on the new tiff. Can I turn tags off somehow?

OLD:

File name: C:\aSampleData\tiffs\old.TIF
File size: 116730 (0x1C7FA) Bytes
Byte Order: Intel
Current IFD: 1 of 3
IFD offset(s): #1 = 54664 (0xD588), #2 = 102656 (0x19100), #3 = 116568 (0x1C758)
Directory Entries: 13 (0xD)
Tag #0: NewSubfileType, ID=254 (0xFE) type=LONG, count=1, Value(s) = 0 (0x0)
Tag #1: ImageWidth, ID=256 (0x100) type=SHORT, count=1, Value(s) = 1653 (0x675)
Tag #2: ImageLength, ID=257 (0x101) type=SHORT, count=1, Value(s) = 2339 (0x923)
Tag #3: BitsPerSample, ID=258 (0x102) type=SHORT, count=1, Value(s) = 1
Tag #4: Compression, ID=259 (0x103) type=SHORT, count=1, Value(s) = 3 = G3
Tag #5: PhotometricInterpretation, ID=262 (0x106) type=SHORT, count=1, Value(s) = 0 = WhiteIsZero
Tag #6: StripOffsets, ID=273 (0x111) type=LONG, count=40, Value(s) = 8 (0x8), 223 (0xDF), 477 (0x1DD), 2838 (0xB16), 4164 (0x1044), 5209 (0x1459), 7128 (0x1BD8), 8864 (0x22A0), 10921 (0x2AA9), 12016 (0x2EF0), 13649 (0x3551), 16081 (0x3ED1), 17368 (0x43D8), 18703 (0x490F), 20278 (0x4F36), 21947 (0x55BB), 23521 (0x5BE1), 25381 (0x6325), 27126 (0x69F6), 28580 (0x6FA4), 29889 (0x74C1), 32135 (0x7D87), 34274 (0x85E2), 36448 (0x8E60), 38683 (0x971B), 40084 (0x9C94), 42505 (0xA609), 44051 (0xAC13), 45103 (0xB02F), 45987 (0xB3A3), 47498 (0xB98A), 48569 (0xBDB9), 50030 (0xC36E), 51750 (0xCA26), 53111 (0xCF77), 53326 (0xD04E), 53541 (0xD125), 53756 (0xD1FC), 53971 (0xD2D3), 54186 (0xD3AA)
Tag #7: SamplesPerPixel, ID=277 (0x115) type=SHORT, count=1, Value(s) = 1
Tag #8: RowsPerStrip, ID=278 (0x116) type=LONG, count=1, Value(s) = 59 (0x3B)
Tag #9: StripByteCounts, ID=279 (0x117) type=LONG, count=40, Value(s) = 215 (0xD7), 254 (0xFE), 2361 (0x939), 1326 (0x52E), 1045 (0x415), 1919 (0x77F), 1736 (0x6C8), 2057 (0x809), 1095 (0x447), 1633 (0x661), 2432 (0x980), 1287 (0x507), 1335 (0x537), 1575 (0x627), 1669 (0x685), 1574 (0x626), 1860 (0x744), 1745 (0x6D1), 1454 (0x5AE), 1309 (0x51D), 2246 (0x8C6), 2139 (0x85B), 2174 (0x87E), 2235 (0x8BB), 1401 (0x579), 2421 (0x975), 1546 (0x60A), 1052 (0x41C), 884 (0x374), 1511 (0x5E7), 1071 (0x42F), 1461 (0x5B5), 1720 (0x6B8), 1361 (0x551), 215 (0xD7), 215 (0xD7), 215 (0xD7), 215 (0xD7), 215 (0xD7), 139 (0x8B)
Tag #10: XResolution, ID=282 (0x11A) type=RATIONAL, count=1, Value(s) = 200 / 1 = 200
Tag #11: YResolution, ID=283 (0x11B) type=RATIONAL, count=1, Value(s) = 200 / 1 = 200
Tag #12: ResolutionUnit, ID=296 (0x128) type=SHORT, count=1, Value(s) = 2 = Inches
Uncompressed Image Size: 483295 (0x75FDF) Bytes
*** End of report ***


NEW:

File name: C:\aSampleData\tiffs\new.TIF
File size: 133382 (0x20906) Bytes
Byte Order: Intel
Current IFD: 1 of 6
IFD offset(s): #1 = 40476 (0x9E1C), #2 = 66056 (0x10208), #3 = 106682 (0x1A0BA), #4 = 116558 (0x1C74E), #5 = 124838 (0x1E7A6), #6 = 133132 (0x2080C)
Directory Entries: 19 (0x13)
Tag #0: NewSubfileType, ID=254 (0xFE) type=LONG, count=1, Value(s) = 2 (0x2)
Tag #1: ImageWidth, ID=256 (0x100) type=SHORT, count=1, Value(s) = 1653 (0x675)
Tag #2: ImageLength, ID=257 (0x101) type=SHORT, count=1, Value(s) = 2339 (0x923)
Tag #3: BitsPerSample, ID=258 (0x102) type=SHORT, count=1, Value(s) = 1
Tag #4: Compression, ID=259 (0x103) type=SHORT, count=1, Value(s) = 3 = G3
Tag #5: PhotometricInterpretation, ID=262 (0x106) type=SHORT, count=1, Value(s) = 0 = WhiteIsZero
Tag #6: FillOrder, ID=266 (0x10A) type=SHORT, count=1, Value(s) = 2 = LSB to MSB
Tag #7: StripOffsets, ID=273 (0x111) type=LONG, count=1, Value(s) = 8 (0x8)
Tag #8: Orientation, ID=274 (0x112) type=SHORT, count=1, Value(s) = 1 (0x1)
Tag #9: SamplesPerPixel, ID=277 (0x115) type=SHORT, count=1, Value(s) = 1
Tag #10: RowsPerStrip, ID=278 (0x116) type=SHORT, count=1, Value(s) = 2339 (0x923)
Tag #11: StripByteCounts, ID=279 (0x117) type=LONG, count=1, Value(s) = 40468 (0x9E14)
Tag #12: XResolution, ID=282 (0x11A) type=RATIONAL, count=1, Value(s) = 200 / 1 = 200
Tag #13: YResolution, ID=283 (0x11B) type=RATIONAL, count=1, Value(s) = 200 / 1 = 200
Tag #14: PlanarConfiguration, ID=284 (0x11C) type=SHORT, count=1, Value(s) = 1 = Chunky
Tag #15: T4Options, ID=292 (0x124) type=LONG, count=1, Value(s) = 5 (0x5)
Tag #16: ResolutionUnit, ID=296 (0x128) type=SHORT, count=1, Value(s) = 2 = Inches
Tag #17: PageNumber, ID=297 (0x129) type=SHORT, count=2, Value(s) = 18761 (0x4949), 42 (0x2A)
Tag #18: SampleFormat, ID=339 (0x153) type=SHORT, count=1, Value(s) = 1 (0x1)
Uncompressed Image Size: 483295 (0x75FDF) Bytes
*** End of report ***

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests