Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2006, 10:52 AM
Authorized User
 
Join Date: Feb 2006
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default Displaying Corrupted JPEG pictures

Hi,

I'm involved in a project that requires me to display JPEG files on webforms.
I can display the normal JPEGs, but when some of the JPEG files are corrupted, these files cannot be displayed.
I've read somewhere that corrupted JPEG files can actually be loaded using the system.drawing class.

Anyone can advise me on this and how to get it done?
(I'm using VB.NET.)

Thanks!

Scripts82
__________________
Scripts82
 
Old September 4th, 2006, 11:49 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Can you load any of the image files into say Photoshop and view them? I have quite a bit of exerpeince with the GDI+ classes and know of no way to recreate a jpg that has been corrupted (I am not saying it isnt possible, i just dont know how).

I will tell you this though, Basic GDI+ howtos are a dime a dozen, it is very hard to find Advanced GDI techniques on the web, so it a way does exist (I would start by checking the MSDN) and work your way out from there.

"The one language all programmers understand is profanity."
 
Old September 8th, 2006, 04:07 AM
Authorized User
 
Join Date: Feb 2006
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi dparsons,

Since you have quite some experience in GDI+, from what you know, are there any ways to "force" a stream of bytes to be displayed as an image?

Thanks.

Scripts82
 
Old September 8th, 2006, 06:38 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No. As far as GDI is concerned an image is an image is an image (once you have loaded an image into GDI it becomes format independant) so if you load a jpg into GDI you can export it as a bitmap no problem; but you can't 'force' gdi to make you a renderable image.

A corruption can occur from many things, like the loss of bytes (data) and gdi has no way of knowing what that data should look like.

"The one language all programmers understand is profanity."
 
Old September 10th, 2006, 02:53 AM
Authorized User
 
Join Date: Feb 2006
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi dparsons,

I think I get what you mean.
Thanks for this clarification!

Scripts82





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a code be corrupted? A Watman PHP Databases 4 March 23rd, 2007 08:46 AM
Response Header getting corrupted Priyank26 Internet Information Services 0 November 13th, 2006 03:39 PM
Displaying pictures louie001 ASP.NET 1.0 and 1.1 Basics 2 November 24th, 2005 04:11 PM
DAPs Corrupted?? JpJoe Access 0 January 10th, 2005 09:45 AM
Corrupted cookies? Jeff Mason Forum and Wrox.com Feedback 0 June 16th, 2003 07:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.