TIFF File Problem

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's Image-XChange Imaging SDK (only).

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Post Reply
glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

TIFF File Problem

Post by glima » Mon Jan 01, 2007 8:24 pm

I have a client that is using my application and is having an issue with a TIFF file. The TIFF file has 4 pages but the Image-XChange libraries (3.6.0.110) report back as 8 pages. Also the system returns an error when trying to process the function IMG_ImageRemovePage for the second page.


As a note an older version of my software using Image-XChange (1.0.0.16) works fine for this document.

Document name is 1997-12-31.TIF
Attachments

[The extension tif has been deactivated and can no longer be displayed.]


John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Jan 02, 2007 12:05 pm

Hi,

As you failed to zip the file - it did not upload - please zip and re-post the file and we will be pleased to investigate.

Please note - all files posted must be archived in a ZIP, RAR or 7z format archive.

thanks.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Post by glima » Tue Jan 02, 2007 2:14 pm

A couple of notes on what the software does.

1. Open document
2. Get number of pages
3. Remove page from existing
4. Using GDI and a DC stamp each page with a watermark
5. Write stamped page to new document.

Step 3 is the following

e = IMG_ImageDecodePage(FileHandle, CurrentPage)
e = IMG_ImageRemovePage(FileHandle, 0, Page)
e = IMG_PageGetSize(Page, Width, Height)
e = IMG_PageGetDPI(Page, xDPI, yDPI)
Attachments
1997-12-31.zip
(104.29 KiB) Downloaded 213 times

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Jan 02, 2007 6:01 pm

Thanks - this is with the project manager responsible - will advise as soon as I have his response.

Thanks for your patience.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Post by glima » Thu Jan 04, 2007 4:05 pm

I have additional information:


Instead of using

e = IMG_ImageRemovePage(FileHandle, 0, Page)

I tried

e = IMG_ImageRemovePage(FileHandle, CurrentPage, Page)

and was able to read all 4 of the pages. Since the API to get the number of pages is returning the incorrect count it still errors when I try to read page 5.


I am still having an issue with DPI reported by
e = IMG_PageGetDPI(Page, xDPI, yDPI)

Attached is a sample file that reports a DPI of 76200 while the MDI reader shows 100.

glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Post by glima » Thu Jan 04, 2007 4:07 pm

File sent via E-Mail due to size.

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Thu Jan 04, 2007 5:29 pm

Thanks George,

Have file - we are working on all the problems reported and hope to have all resolved over the weekend.

Thanks for your patience.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Thu Jan 04, 2007 5:57 pm

One additional point George,

Image-XChange is reporting the correct DPI for this file - if you view the properties of this TIFF file in windows explorer and various other imaging applications - the properties are reported as :

width 2560 pixels
Height 3300 pixels
H Res : 76200 DPI
V Res 76200 DPI
Bit depth : 1

I have checked also in Office Picture Manager (from Office 2007), Windows Picture and Fax Viewer and Paintbrush and all agree with Image-XChange
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Jan 10, 2007 7:04 pm

Hi george,

the original problem reported is now resolved in the new build 3.601102 now available for download from our web pages :

download latest Releases
http://www.tracker-software.com/downloads/dev/

Thanks for your patience whilst this was corrected.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Post by glima » Sat Jan 13, 2007 6:32 pm

I downloaded the latest version with the DLL dated 1/10/07 but it still has problems with the original file. It reports that there are 8 pages even though there are only 4.

I did notice that the version on the ixclib.dll was 3.60.0110 and not the stated 3.60.1102.

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Sat Jan 13, 2007 7:50 pm

Hi George,

the DLL version number is not changed as this is a minor build update - could you please confirm that all DLL date's are : 10th January 2007 ?

Thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Post by glima » Mon Jan 15, 2007 5:41 am

Yes I am using the files dated 1/10/07.

I have been able to make some adjustments to the code to make our software work. I am using the

e = IMG_ImageRemovePage(FileHandle, 0, Page)

funtion which will error.

The issue is that we have an option to stamp number across documents. If the number of pages returned is incorrect then the documents will not be numbered correctly.

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Mon Jan 15, 2007 1:46 pm

Hi George,

we have tested here and all appears correct with the latest release - are you sure you dont have the older DLL located anywhere on your system that perhaps windows is referencing in error - say perhaps in your \system32 folder or elesewhere ?
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Post by glima » Mon Jan 15, 2007 8:20 pm

I am using the latest.


Here is the process I am going through.

Open Document
IMG_GetPagesCount
Loop NumberofPages
IMG_DecodePage
IMG_RemovePage
IMG_PageGetSize
IMG_PageGetDPI
IMG_PageGetFormat
IMG_PageGetDC
Write Some Text to DC
IMG_ImageCreateEmpty
IMG_ImageInsertPage
IMG_ImageInsertPagesToFile
IMG_PageDestroy
IMG_ImageDestroy
End of Loop

With the new libraries the system reports back that the "1997-12-31.TIF" file has 8 pages. It only has 4. In the same document the libraries report back an incorrect DPI (0,0) for each even page.

Again, I have tried the IMG_RemovePage function two different ways with different results.

IMG_ImageRemovePage(FileHandle, 0, Page)
When used like this the libraries error when on page 5. This causes issues with other TIF files not to process the last page. (See attached file)

IMG_ImageRemovePage(FileHandle, CurrentPage, Page)
When used like this there is no error and the system processes it like there were 8 pages. The problem is that when stamping pages consecutively across multiple document the numbering is wrong.

Doc A 1-8
Doc B 9-11

it should be

Doc A 1-4
Doc B 5-7
Attachments
TEST2.zip
(90.73 KiB) Downloaded 245 times

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Tue Jan 16, 2007 7:40 am

Hi George,

can you please provide a small sample application (source code and compiled) with all supporting files (dll's and any other's) required and a simple explanation of how to use to show the problem.

Please ZIP any files sent and if large you can send direct to johnv@tracker-software.com, if more convenient, and we will investigate urgently

thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Sun Jan 21, 2007 11:52 am

Hi George,

I now have a code example to allow you to resolve the problem found - we will update the Clarion classes etc next week as soon as we have caught up after our power outage of Thursday-Saturday - which has left us with a bit of a backlog.

As previously explianed your file does in fact contain 8 pages - 4 pages as expected + 4 thumbnail pages.

The previous release of Image-XChange interpreted all pages in the Tiff file as a full image, but this is not always so.

In the later release you have this is resolved - but you have to do a little additional work in your code - for every page - check the page property using code similar to that below:

IMG_PageGetFormatLongParameter(PAGE_HANDLE,LONG,*LONG),HRESULT,RAW,PASCAL

propertyValue LONG
hRes LONG
pageIsThumbnail BOOL

hRes = IMG_PageGetFormatLongParameter(hPage, 05448554dH, propertyValue) IF hRes < 0 OR propertyValue = 0 THEN
pageIsThumbnail = FALSE
ELSE
pageIsThumbnail = TRUE
END

The number of pages is number of pages with pageIsThumbnail = FALSE. IF pageIsThumbnail = TRUE the the page should not be processed (ignored or removed from original image).

first you must :

1. Get pages count.
2. The value includes thumbnail pages, but to get number of real images, you must loop through all pages checking the thumbnail property (05448554dH - id value).
3. Remove thumbnails or ignore these as required.

Hope that helps and thanks for your patience.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Post by glima » Mon Jan 29, 2007 5:47 pm

That worked great. I have one slight problem in that the system increments to the next possible number before it gets to the page. This is due to the different number formats and document formats we are able to process.

I would like to preprocess any TIF files, locating the thumbnails. In order to not process ALL TIF's in this manner is there any function that I can use to determine if the TIF file has thumbnails present. I would then only preprocess these documents.

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Post by Tracker - Clarion Support » Tue Jan 30, 2007 11:07 am

Hi George!

We are making changes to the IXCTools35Class to handle the "true" pages vs. thumbnails inside the class files.

When complete you will be able to use the class methods just as if there are no thumbnails. The class will handle page counting and position conversion "under the hood" so to speak.

This should be out Tuesday.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Post by Tracker - Clarion Support » Wed Jan 31, 2007 2:42 am

Hi George!

Had to fight a few fires today.

Should be out tomorrow.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Jan 31, 2007 9:05 pm

Hi George,

you can download the revised Image-XChange SDK from this link :

http://www.tracker-software.com/IMXV3CW.zip

HTH
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply