|
Hi,
I have had success with converting thousands of fax pages from tif to
png with this code, but I have a client with computer generated faxes
that are now causing issues with this conversion and I cannot figure
out why or how they are different. When I look at the property of
the TIF files, they have the same compression as others, and the main
diff is the size, they are 2292L X 1728 pixels wide, with Resolution
X of 204dpi and Resolution Y of 196dpi.
The TIF files open fine in windows, and all incoming tif files are
generated by our fax2email company.
The fax fails at this line (code section follows
below):
If objAIL.Convert_ImageToBitmap(hIMG(lngCounter),
hBITMAP) = True Then...
"objAIL.Error_GetLast" does not return any information.
I cannot freely distribute the fax tif file because of patient
confidentiality, so please give me an email to send directly to, or
let me know if there is more debugging I can do.
Thanks,
Chay
Section Code:
'0 error
If objAIL.MultiPage_Load(file, hIMG, lngTotal) = True Then
Response.Write "Loaded " & CStr(lngTotal) & " images from the multi-
page TIFF<BR>"
For lngCounter = 0 To lngTotal - 1
response.write fax_pending_folder & "\" &
replace(mainfile.name,".tif","") & "_" & lngCounter & ".png" & "<BR>"
'1 error
If objAIL.Convert_ImageToBitmap(hIMG(lngCounter),
hBITMAP) = True Then
'2 error
If objAIL.IO_SaveImage(hIMG(lngCounter),
fax_pending_folder & "\" &
replace(mainfile.name,".tif","") & "_" & lngCounter & ".png", IF_png,
png_default, True) = True Then
'3 error
If objAIL.IO_SaveImage(hIMG(lngCounter),
fax_pending_copy_folder & "\" &
replace(mainfile.name,".tif","") & "_" & lngCounter & ".png", IF_png,
png_default, True) = True Then
else
Response.Write "Error - " & objAIL.Error_GetLast & "3<BR>"
end if
Else
Response.Write "Error - " & objAIL.Error_GetLast & "2<BR>"
End If
Call objAIL.IO_DestroyBitmap(hBITMAP)
Else
Response.Write "Error - " & objAIL.Error_GetLast & "1<BR>"
End If
Call objAIL.IO_DestroyImage(hIMG(lngCounter))
Next
Else
Response.Write "Error - " & objAIL.Error_GetLast & "0<BR>"
End If
|