Solved

Error 481 on valid image - loadpicture

Posted on 2000-03-10
14
468 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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
 

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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

809 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