Print Page | Close Window

ASPJpeg question

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=10064
Printed Date: 31 March 2026 at 4:32pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASPJpeg question
Posted By: zMaestro
Subject: ASPJpeg question
Date 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.




Replies:
Posted By: michael
Date 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.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: pmormr
Date 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



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: dpyers
Date 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.

 

 



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: zMaestro
Date 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



Posted By: zMaestro
Date Posted: 21 April 2004 at 7:27am

The Error is in line:

Jpeg.Open JpegPath



Posted By: Mart
Date Posted: 21 April 2004 at 11:14am
Put 'On Error Resume Next' before the  Jpeg.Open JpegPath line



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net