Solved

Error 481 on valid image - loadpicture

Posted on 2000-03-10
14
456 Views
Last Modified: 2008-02-20
Please download the following image. If you load it into a graphics program like Paint Shop or another commercial software, it works fine, but Visual Basic rejects it, sending a 481 error. Why.

http://www.navigations2000.com/thorses.jpg

I hope someone knows enough about images to be able to examine this file and tell me what is the problem. The reason this file is important is because I want my image viewer to be able to load files that may have some "unloaded" problem.

If it's possible to load this file into a variable then save it as a new image without actually loading it into a picture control, then that would work well I believe. I just don't understand why Visual Basic is rejecting it.


0
Comment
Question by:microfleet
  • 8
  • 6
14 Comments
 

Author Comment

by:microfleet
ID: 2603684
Oh yea, to save the file you will probably need to use the SAVE-AS-LINK option from your browser because the browser doesn't want to show the image any more than my program does. I would actually think the file is bad except that all the graphic programs I've used will display it.
 
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2603814
None of the graphic programs I have will display that file...



Cheers!®©
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2603848
If you have a program that will read the image and display it, and that program has the capability to save, then resave the file to a new name and see of you still have the same problems with the new file....


Cheers!®©
0
 

Author Comment

by:microfleet
ID: 2603868
Oh yea, to save the file you will probably need to use the SAVE-AS-LINK option from your browser because the browser doesn't want to show the image any more than my program does. I would actually think the file is bad except that all the graphic programs I've used will display it.
 
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2603894
microfleet... Repeating yourself?? ;-)
0
 

Author Comment

by:microfleet
ID: 2605908
no, the system must have done that
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2607085
So did you try saving the image as a new file??


Cheers!®©
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:microfleet
ID: 2608399
Yea I can pull the image info in and store it in a variable, then output it into another file but it's just the same information that I'm putting into the other file. I know if I could get it to load into a picture box then I could save it and it would reformat to work without any problem. But of course the troulbe is getting it to load. I am trying to figure out if I can just get so many bytes from the damaged image and display just that much of it, but I dont know how much of the information to gather from the damaged image. So its gotten very technical I think. Paint Shop Pro and Picture Viewer both display the image without any trouble, so I know the file is viewable, I was just hoping someone knew enough about graphics to understand why.

thanks
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2608685
Try this:

1) Start "Paint Shop Pro".

2) Open the file thorses.jpg

3) Do a "File->Save As" and save the image as thorses1.jpg

4) Close "Paint Shop Pro".

5) Try using thorses1.jpg in your VB program... It should load into a picturebox with no problem...



Cheers!®©
0
 

Author Comment

by:microfleet
ID: 2608700
mcrider, yes that will work just fine but I'm not trying to get Paint Shop Pro to read the image, it does that well enough. I'm trying to figure out why Visual Basic won't read it. Loading it into another program and repairing the image is not going to help my program if it encounters another image that acts this same way. I am trying to figure out how to get Visual Basic to load the damaged file, in some way. If I fix the file first, then that is defeating the purpose.
But thanks anyway
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2608883
Take a look at the "fixed" file and compare the header against the file that will not load. There has to be some kind of variation... For example, the picture was created using MAC instead of PC and still has the MAC header...

For header information, check out the site: http://wotsit.org/ and do a search for "jpg".



Cheers!®©
0
 

Author Comment

by:microfleet
ID: 2609109
mcrider, make that an answer. The information has got me making a viewer for jpg. With that I can attempt to reconstruct the bytes as they are put into a variable. It may and may not work but I think I might be able to get a good resemblence to the original image.
0
 
LVL 14

Accepted Solution

by:
mcrider earned 50 total points
ID: 2609197
Take a look at the "fixed" file and compare the header against the file that will not load. There has to be some kind of variation... For example, the picture was created using MAC instead of PC and still has the MAC header...

For header information, check out the site: http://wotsit.org/ and do a search for "jpg".



Cheers!®©

0
 
LVL 14

Expert Comment

by:mcrider
ID: 2610331
Thanks for the points! Glad I could help!


Cheers!®©

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now