Possible Windows 7 Related Bug

Discussions about image processing and document imaging.
Post Reply
clocklear
Posts: 16
Joined: Fri Jan 11, 2008 11:04 pm

Possible Windows 7 Related Bug

Post by clocklear » Wed Jan 13, 2010 10:38 pm

I think I just found a bug you might want to know about:

Code: Select all

PROCEDURE ConvertTIFToFax
	LPARAMETERS cInFile, cOutFile
	WITH oImaging AS GdPicturePro5.Imaging
		LOCAL nImage,nPgCnt,nNewImage,lnPageCnt,n,nNewMultiPage,lcTmpFile
		lcTmpFile = SYS(3)+SYS(2015)+'.TIF'
		COPY FILE "&cInFile" TO "&lcTmpFile"
		IF NOT DIRECTORY('.\WORK\')
			MKDIR '.\WORK\'
		ENDIF 
		DELETE FILE '.\WORK\*'
		nImage = .TiffCreateMultiPageFromFile("&lcTmpFile")
		nPgCnt = .TiffGetPageCount(nImage)
		lnPageCnt = 0
		FOR N = 1 TO nPgCnt
			.TiffSelectPage(nImage,N)
			.SetContrast(150)
			.ConvertTo1Bpp()
			.SaveAsTIFF(".\WORK\"+PADL(ALLTRIM(TRANSFORM(n)),2,'0')+'.tif',4)
		ENDFOR
		.CloseImage(nImage)
		FOR n = 1 TO nPgCnt
			nImage = .CreateImageFromFile(".\WORK\"+PADL(ALLTRIM(TRANSFORM(n)),2,'0')+'.tif')
			IF lnPageCnt = 0
				.TiffSaveAsNativeMultiPage("&cOutFile",4)
			ELSE			
				.TiffAddToNativeMultipage(nImage)
			ENDIF 
			lnPageCnt = lnPageCnt + 1
			.CloseImage(nImage)
		ENDFOR 
		.TiffCloseNativeMultiPage()
		DELETE FILE "&lcTmpFile"
		DELETE FilE ".\WORK\*"	
	ENDWITH
ENDPROC
(mind you, I know there are easier ways to do this, but I ended up here because everything else I was trying wasn't working.. I wanted to ensure each page was definitely saved as CCITT4)

In Windows XP, this code will take an input multipage tiff, convert each page to B&W, boost the contrast a bit, and save to the output file. Each page of the target TIFF is saved as Group 4 Fax encoding. In Windows 7, only the first page of the multipage tiff is saved as CCITT4, the rest are saved as LZW.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Possible Windows 7 Related Bug

Post by Loïc » Fri Jan 15, 2010 3:34 pm

Hi,

Please, send us the resulting tiff image for investigation at esupport (at) gdpicture (dot) com.

With best regards,

Loïc

clocklear
Posts: 16
Joined: Fri Jan 11, 2008 11:04 pm

Re: Possible Windows 7 Related Bug

Post by clocklear » Thu Jan 21, 2010 4:40 pm

Email sent. Sorry for the delay.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Possible Windows 7 Related Bug

Post by Loïc » Thu Jan 21, 2010 9:38 pm

Hi,

Problem solved for the next release.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest