An exception occurred: 'LoadBitmap'

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

nec
Posts: 11
Joined: Mon Sep 27, 2004 2:12 am

An exception occurred: 'LoadBitmap'

Post by nec »

Hi,

When i try to load a .jpg file in ASP with: .LoadBitmap sFile
I get this error message: An exception occurred: 'LoadBitmap'

The object is set with Set ctrl = server.createobject("GflAx.GflAx") and did work fine until recently.

I have no idea why, but i need it fixed.
Any suggestions?
nec
Posts: 11
Joined: Mon Sep 27, 2004 2:12 am

Post by nec »

The call worked after a IISRESET, but its kinda scary that it came up at all...
Does anyone know what it was?
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

nec wrote:The call worked after a IISRESET, but its kinda scary that it came up at all...
Does anyone know what it was?
Could you send me the picture that you load?
Pierre.
nec
Posts: 11
Joined: Mon Sep 27, 2004 2:12 am

Post by nec »

It was a whole bunch of pictures,
All .jpg

They work now, but im still curious of why this happened.
nec
Posts: 11
Joined: Mon Sep 27, 2004 2:12 am

Post by nec »

Hmm, now it happened again.
I have no idea whu.
Works after a IISRESET.


Please help me out.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

nec wrote:Hmm, now it happened again.
I have no idea whu.
Works after a IISRESET.
Could you show me more about your script?
Pierre.
nec
Posts: 11
Joined: Mon Sep 27, 2004 2:12 am

Post by nec »

This is a function called AFTER a ranomization is done, with a global array called aBefore, and aUsers wich includes SID's (relevant to the path). The function returns x amount of linked pictures (with javascript calls) and checks that the picture isnt already loaded.

Code: Select all

function getRandomizedPicture(nTime)
	
	on error resume next
	
	dim i
	dim bBefore
	
	dim fs
	dim objFile
	dim sFilePath
	dim ctrl
	
	Set ctrl = server.createobject("GflAx.GflAx")
	Set fs=Server.CreateObject("Scripting.FileSystemObject")
	
	bBefore = 0 
	nActiveSID = Int(Rnd*ubound(aUsers,2))
	sPicture = aUsers(1,nActiveSID)
	
	for i = 0 to ubound(aBefore)
		if nActiveSID = aBefore(i) then 
			nTime = i
		end if
	next
	
	if instr(lcase(sPicture), ".jpg") > 0 then
		sPath = left(sPicture, instrrev(sPicture, "/"))
		sPicture = right(sPicture, len(sPicture)-instrrev(sPicture, "/"))
		sPicture = sPath & "_thumb_" & sPicture
		
		sFilePath = replace(sPicture, "/", "\")
		sFilePath = "C:\Inetpub\GenerationV\root" & sFilePath
		if fs.FileExists(sFilePath) = true then
			
			with ctrl
			.LoadBitmap sFilePath
			
			nWidth = nWidth + .Width + 4
			
			if nWidth < 560 then
				aBefore(nTime) = nActiveSID
				getRandomizedPicture = "<a href=""javascript:parent.loadintoIframe('contens','" & sOthersLink & "&SID=" & aUsers(0,nActiveSID) & "')""><img src=""" & sPicture & """ height=""59"" border=""0"" class=""border"" hspace=""2"" vspace=""2""></a>"
			else
				exit function
			end if
			
			end with
			
		else
			getRandomizedPicture = getRandomizedPicture(nTime)
		end if
	else
		getRandomizedPicture = getRandomizedPicture(nTime)
	end if
	
	
	Set fs= nothing
	set ctrl=nothing
	
	on error goto 0
	
end function
The error has accured once more since my last post. Again the IISRESET solved the problem temporary.

Please help!
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

nec wrote:This is a function called AFTER a ranomization is done, with a global array called aBefore, and aUsers wich includes SID's (relevant to the path). The function returns x amount of linked pictures (with javascript calls) and checks that the picture isnt already loaded.
The error has accured once more since my last post. Again the IISRESET solved the problem temporary.
Please help!
Strange, you have only a LoadBitmap??? Which version do you use? The error occurs after x .LoadBitmap?
Pierre.
nec
Posts: 11
Joined: Mon Sep 27, 2004 2:12 am

Post by nec »

No, the error is called WHEN the .LoadBitmap sFilePath is executed.

The other call to the ctrl object is the nWidth = nWidth + .Width + 4 call. The function returns a HTML string of pictures that all together doesnt exeed 560px width. It also checks that the active picture isnt already included.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

nec wrote:No, the error is called WHEN the .LoadBitmap sFilePath is executed.

The other call to the ctrl object is the nWidth = nWidth + .Width + 4 call. The function returns a HTML string of pictures that all together doesnt exeed 560px width. It also checks that the active picture isnt already included.
Do you use the last version?
Pierre.
nec
Posts: 11
Joined: Mon Sep 27, 2004 2:12 am

Post by nec »

No, i had the 2.01 version installed.
I've updated it.

I'll be back if i run into further problems.

Thanks for the help.
Guest

Post by Guest »

I'm still experiencing the same problem.
Once a day or something the component seems to crash the IIS aswell.

Maybe i should tell you that i use the code above on the start page of the web - and that the .width param is accessed 20 times each time a user logs on. Could there be some kinda memory problem?
nec
Posts: 11
Joined: Mon Sep 27, 2004 2:12 am

Post by nec »

that was nec of course.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Anonymous wrote:I'm still experiencing the same problem.
Once a day or something the component seems to crash the IIS aswell.
Maybe i should tell you that i use the code above on the start page of the web - and that the .width param is accessed 20 times each time a user logs on. Could there be some kinda memory problem?
.Width is only a property, LoadBitmap occurs only one time. Do you use now the last v2.20?
Pierre.
nec
Posts: 11
Joined: Mon Sep 27, 2004 2:12 am

Post by nec »

Yes.
Now it hung again - with the errormessage above...
Post Reply