We are using GflAx 2.82 on a legacy web-based application on Classic ASP running on a Windows 2012 R2 server. The component works great, but very randomly we see this error:
Error: File /inc/inc_displayImage.asp CreateObject Exception. The CreateObject of '(null)' caused exception C0000005..
This happens anywhere from once every few days to several times a day. As soon as this error is thrown, its followed by the Application Pool crashing:
A process serving application pool 'DefaultAppPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was '3208'. The data field contains the error number.
I have been going crazy trying to figure out why this is happening. If anyone has any thoughts at all on what could be happening I would appreciate it!
Here is the code if that helps:
Code: Select all
<%
strTable = noXSSQueryString("table")
strImageField = noXSSQueryString("imageField")
strImageExt = noXSSQueryString("imageExt")
strImageFileName = noXSSQueryString("imageFileName")
strIDfield = noXSSQueryString("idField")
strID = noXSSQueryString("id")
strHeight = noXSSQueryString("height")
strWidth = noXSSQueryString("width")
strCrop = noXSSQueryString("crop")
If Len(strImageFileName) > 0 Then Response.AddHeader "content-disposition","inline;filename=" & strImageFileName
strSQL = "Select " & strImageField & " From " & strTable & " Where " & strIDfield & "=? AND " & strImageField & " IS NOT NULL"
strParams = Array(strID)
rsSQL objRS, strSQL, strParams
If not objRS.eof Then
If Len(strCrop) < 1 Then
If Len(strHeight) > 0 Or Len(strWidth) > 0 Then
'Set ctrl = server.createobject("GflAx.GflAx")
Set ctrl = createobject("GflAx.GflAx")
With ctrl
'.ReceiveBinary objRS(strImageField).value
.getBlob objRS(strImageField).value
.SaveformatName = "jpeg"
If Len(strWidth) > 0 And Len(strHeight) > 0 Then
newWidth = strWidth
newHeight = (strWidth * .Height) / .Width
If newHeight > strHeight Then
newWidth = (strHeight * .width) / .height
newHeight = strHeight
End If
.Resize newWidth, newHeight
ElseIf Len(strWidth) > 0 Then
newWidth = strWidth
newHeight = (strWidth * .Height) / .Width
.Resize newWidth, newHeight
ElseIf Len(strHeight) > 0 Then
newWidth = (strHeight * .width) / .height
newHeight = strHeight
.Resize newWidth, newHeight
Else
.Resize 100,100
End If
If strWatermark = True Then
.FontName = "impact"
.FontSize = 21
.TextOut "", 2, 2, RGB(0, 176, 216)
End if
.SaveJPEGQuality = 90
response.contentType = "image/jpeg"
response.binarywrite .SendBinary
End With
Set ctrl=nothing
Else
Response.ContentType = "image/jpg"
Response.BinaryWrite(objRS(strImageField))
End If
End If
If Len(strCrop) > 0 Then
strRatio = strWidth / strHeight
If Len(strHeight) > 0 Or Len(strWidth) > 0 Then
'Set ctrl = server.createobject("GflAx.GflAx")
Set ctrl = createobject("GflAx.GflAx")
With ctrl
.getBlob objRS(strImageField).value
.SaveformatName = "jpeg"
If strWidth / strHeight < strRatio Then
newWidth = strWidth
newHeight = (newWidth * .Height) / .Width
ElseIf strWidth / strHeight > strRatio Then
newHeight = strHeight
newWidth = (newHeight * .Width) / .Height
Else
newWidth = strWidth
newHeight = (newWidth * .Height) / .Width
End If
.Resize newWidth, newHeight
.ResizeCanvas strWidth, strHeight, strCrop
.SaveJPEGQuality = 90
response.contentType = "image/jpeg"
response.binarywrite .SendBinary
End With
Set ctrl=nothing
Else
Response.ContentType = "image/jpg"
Response.BinaryWrite(objRS(strImageField))
End If
End If
end if
rsCLOSE(objRS)
%>