Problemer med ASPimage - Overflow
Hey.Jeg har lavet et nyhedssystem hvor man kan uploade et billed til, jeg har bare det problem at når jeg tilføjer en nyhed med billed på får jeg denne fejl:
Microsoft VBScript runtime error '800a0006'
Overflow
/addnews.asp, line 197
her er upload koden og ASPimage koden:
Set lastnews = Conn.Execute("Select * from news order by id asc")
If mySmartUpload.Files.Item(1).IsMissing Then
NewHeight = 50
NewWidth = 50
Set objImg = Nothing
Set Image = Server.CreateObject("AspImage.Image")
Image.LoadImage server.MapPath("news_big_156.jpg")
Image.ImageFormat = 1
Image.JPEGQuality = 500
Image.ResizeR NewWidth,NewHeight
Image.FileName = server.mappath("news_small_"& lastnews("id")&".jpg")
Image.SaveImage
size = 250
NewHeight = size
NewWidth = size
Set objImg = Nothing
Set Image = Server.CreateObject("AspImage.Image")
Image.LoadImage server.MapPath("news_big_156.jpg")
Image.ImageFormat = 1
Image.JPEGQuality = 500
Image.ResizeR NewWidth,NewHeight
Image.FileName = server.mappath("news_big_"& lastnews("id") &".jpg")
Image.SaveImage
else
mySmartUpload.Files("pic").SaveAs Server.MapPath("news_"& lastnews("id") &".jpg")
Set objImg = Server.CreateObject("AspImage.Image")
objImg.LoadImage server.MapPath("news_" & lastnews("id") & ".jpg")
ImageHeight = objImg.MaxY
ImageWidth = objImg.MaxX
NewHeight = 50
NewWidth = 50
Set objImg = Nothing
Set Image = Server.CreateObject("AspImage.Image")
Image.LoadImage server.MapPath("news_"& lastnews("id") &".jpg")
Image.ImageFormat = 1
Image.JPEGQuality = 500
Image.ResizeR NewWidth,NewHeight
Image.FileName = server.mappath("news_small_"& lastnews("id") &".jpg")
Image.SaveImage
size = 250
NewHeight = Cint(ImageHeight*size/ImageWidth)
NewWidth = size
Set objImg = Nothing
Set Image = Server.CreateObject("AspImage.Image")
Image.LoadImage server.MapPath("news_"& lastnews("id") &".jpg")
Image.ImageFormat = 1
Image.JPEGQuality = 500
Image.ResizeR NewWidth,NewHeight
Image.FileName = server.mappath("news_big_"& lastnews("id") &".jpg")
Image.SaveImage
end if
'Response.BinaryWrite Image.Image
Set Image = Nothing
Linje 197:
NewHeight = Cint(ImageHeight*size/ImageWidth)
Hvad er der galt???
/Peppino