Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASPJpeg question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASPJpeg question

 Post Reply Post Reply
Author
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Topic: ASPJpeg question
    Posted: 20 April 2004 at 6:28am

I'm using ASPJpeg, i face a problem. I'm using in a gallery this component to create thumbnails for images posted by visitors, but sometimes visitors images are not found on the server, so I get this error:

Persits.Jpeg.1 (0x800A0002)
The system cannot find the file specified.

Is there a way I can stop this error from loading... i.e. if image was not found to continue load the page without the image.

Thanks.

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 20 April 2004 at 9:53am
Just do an error handler (On Error Resume Next) and handle it at each gallery item -- If err > 0 THEN <missingimage.jpg> else <yourimage.jpg> -- reset error.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 20 April 2004 at 10:14pm

there is one thing that i wish asp would do... allow something like 'On Error Goto ErrorCode'... i like the way VB.NET handles it though...

Try
   'code
Catch ex as Exception
   'exception code
End Try

that way you don't have to put error skip protection on your whole script

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2004 at 2:42am

You can use err and err.description to do special handling - e.g.

If Err <> 0 Then ...

     or

If instr(Err.Description, "Persits.Jpeg.1") Then ...

You can check these anytime - even if you do an On error Resume Next esrlier in the script.

 

 



Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2004 at 7:10am

didn't work

Set Jpeg = Server.CreateObject("Persits.Jpeg")
JpegPath = Server.MapPath("./eShop/") & "\" & RSpecial("Image") & ""
Jpeg.Open JpegPath
Jpeg.Height = 150
Jpeg.Width = jpeg.OriginalWidth * jpeg.Height / jpeg.OriginalHeight

If Err <> 0 Then
Jpeg.Save Server.MapPath("./eShop/") & "\" & RSpecial("Image") & ""
End If

Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2004 at 7:27am

The Error is in line:

Jpeg.Open JpegPath

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2004 at 11:14am
Put 'On Error Resume Next' before the  Jpeg.Open JpegPath line
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.