Alexander,
I appreciate the response! Your GDIPLUS wrapper is phenomenol...if anyone can help it will probably be you!
The weird thing about the bad images is that the image properties show nothing:
loImg.ImageFormat = ""
loImg.ImageHeight = 0
loImg.ImageWidth = 0
loImg.HorizontalResolution = 0.0
loImg.VerticalResolution = 0.0
Actually, even for good TIFs all of the image information is empty.
Well, it appears any image I process is showing empty image properties. But the images save off as separate pages the way they are supposed to. Here is the code I use to split pages out into temporary page files (that I then store in database):
loInit = NEWOBJECT("gpInit", "gpImage.PRG")
loImg = NEWOBJECT("gpImage", "gpImage.PRG")
loImg.Load(pcFile)
lnPages = MAX(loImg.GetPageCount(), 1)
FOR i = 0 TO lnPages - 1
loImg.SelectPage(i)
loImg.SaveAsTIFF(ADDBS(pcSplitDir) + pcSplitFilePrefix + TRANSFORM(i))
ENDFOR
As you can see, it is after I call SelectPage that I check the image properties, and the properties are all empty or zero.
At first I thought it was something with the GDI wrapper causing the problem, and that was why the properties were empty. But then I looked at the file saved off from Outlook and saw that some TIFs were already stretched out and others weren't. As I said in my follow-up post, all TIFs saved out of Outlook look fine when viewed with a TIF viewer such as Microsoft Office Document Imaging. But when using a standard graphics viewer (like Microsoft Office Picture Manager), some TIFs look stretched out while others look fine. We have to use a standard viewer (we use a Pegasus OCX in our production system), as our graphics include TIFs, JPGs, PNGs, etc.
I e-mailed "good" and "bad" TIFs to the other gentleman who responded to this post, so maybe he can see the difference between the TIFs.
Would you have any idea why the GDI wrapper would be returning empty or zero image properties? Any help would be greatly appreciated!
Thanks,
JoeK