468,554 Members | 1,892 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,554 developers. It's quick & easy.

Picture Problem - jpg won't load

I am making a program that categorizes pictures. The picture paths
are stored in an Access Database, vb6 connects using adodc controls.
This program works specifically with .jpg files. It will be used by
people categorizing thousands of images.

The problem I have is that both the picture control, and the image
control seem unable to open certain jpg images for an unknown reason.
The error message simply states "Invalid Picture". I can open these
problem picturesin MS Paint or any other photo editor and the images
works fine - the problem with the file seems to be limited to the vb6
controls.

Has anyone else had this problem?

I have made a duct tape solution by identifying what the native jpg
program is on the user's machine, but can't yet figure out how to run
that program and load the trouble picture into it. ie: if paint.exe
is the program associated to .jpg extensions, then open the problem
image's path in paint.

Does anyone know what the syntax/commands are to do such a thing?

Thanks!!

Trevor
Jul 17 '05 #1
3 13589
tr*****@e-crime.on.ca (Trevor Fairchild) wrote in message news:<5b**************************@posting.google. com>...
I am making a program that categorizes pictures. The picture paths
are stored in an Access Database, vb6 connects using adodc controls.
This program works specifically with .jpg files. It will be used by
people categorizing thousands of images.

The problem I have is that both the picture control, and the image
control seem unable to open certain jpg images for an unknown reason.
The error message simply states "Invalid Picture". I can open these
problem picturesin MS Paint or any other photo editor and the images
works fine - the problem with the file seems to be limited to the vb6
controls.

Has anyone else had this problem?

I have made a duct tape solution by identifying what the native jpg
program is on the user's machine, but can't yet figure out how to run
that program and load the trouble picture into it. ie: if paint.exe
is the program associated to .jpg extensions, then open the problem
image's path in paint.

Does anyone know what the syntax/commands are to do such a thing?

Thanks!!

Trevor


Just a wild shot...

There are different JPG format out, and VB6 isn't exactly new, so it
could be that some newer formats are not supported (you can see the
same problems with some old paint programs).
In this case you might try it using API functions, although I can't
tell you exactly how to do it.
The problem with your "duct tape solution" is that the Shell command
can only run executables, but cannot simulate a double-click on the
file. I know no solution for that, sorry.

Robert
Jul 17 '05 #2
not really no Trevor,

What you can do in VB is concatenate quotes..such as

SHELL "C:\Windows\
Shell "C:\windows\system32\mspaint.exe " & chr(34) & "c:\my picture.jpg" &
chr(34)

this should open it fine...it has for me

--
Stéphane Richard
Senior Software and Technology Supervisor
http://www.totalweb-inc.com
For all your hosting and related needs
"Trevor Fairchild" <tr*****@e-crime.on.ca> wrote in message
news:5b*************************@posting.google.co m...
as*********@yahoo.com (Asperamanca) wrote in message

news:<3b**************************@posting.google. com>...
tr*****@e-crime.on.ca (Trevor Fairchild) wrote in message news:<5b**************************@posting.google. com>...
I am making a program that categorizes pictures. The picture paths
are stored in an Access Database, vb6 connects using adodc controls.
This program works specifically with .jpg files. It will be used by
people categorizing thousands of images.

The problem I have is that both the picture control, and the image
control seem unable to open certain jpg images for an unknown reason.
The error message simply states "Invalid Picture". I can open these
problem picturesin MS Paint or any other photo editor and the images
works fine - the problem with the file seems to be limited to the vb6
controls.

Has anyone else had this problem?

I have made a duct tape solution by identifying what the native jpg
program is on the user's machine, but can't yet figure out how to run
that program and load the trouble picture into it. ie: if paint.exe
is the program associated to .jpg extensions, then open the problem
image's path in paint.

Does anyone know what the syntax/commands are to do such a thing?

Thanks!!

Trevor


Just a wild shot...

There are different JPG format out, and VB6 isn't exactly new, so it
could be that some newer formats are not supported (you can see the
same problems with some old paint programs).
In this case you might try it using API functions, although I can't
tell you exactly how to do it.
The problem with your "duct tape solution" is that the Shell command
can only run executables, but cannot simulate a double-click on the
file. I know no solution for that, sorry.

Robert


Thanks, Robert. I was working on my 'duct tape' solution last night
and found out that the following command:

Shell "C:\windows\system32\mspaint.exe c:\mypicture.jpg"

will load mypicture.jpg into MS Paint.

Unfortunately, this doesn't work if the path or file name of the jpg
have a space in it.

Shell "C:\windows\system32\mspaint.exe c:\my picture.jpg"

doesn't work because the program is looking for c:\my.bmp...

Shell "C:\windows\system32\mspaint.exe 'c:\my picture.jpg'"

doesn't work either although I don't know why. I have tried square
brackets, and parentheses, and nothing seems to work. Conversely,

c:\windows\system32\mspaint.exe "c:\my picture.jpg"

will work when I go through the 'Run' Command of windows. For some
reason the single quotes don't cut it in this case, perhaps another
limitation of vb6...?

Jul 17 '05 #3
It worked exactly like it should! Thank you very much for your help.

"Stephane Richard" <st**************@verizon.net> wrote in message news:<DQ*****************@nwrdny02.gnilink.net>...
not really no Trevor,

What you can do in VB is concatenate quotes..such as

SHELL "C:\Windows\
Shell "C:\windows\system32\mspaint.exe " & chr(34) & "c:\my picture.jpg" &
chr(34)

this should open it fine...it has for me

--
Stéphane Richard
Senior Software and Technology Supervisor
http://www.totalweb-inc.com
For all your hosting and related needs
"Trevor Fairchild" <tr*****@e-crime.on.ca> wrote in message
news:5b*************************@posting.google.co m...
as*********@yahoo.com (Asperamanca) wrote in message

news:<3b**************************@posting.google. com>...
tr*****@e-crime.on.ca (Trevor Fairchild) wrote in message news:<5b**************************@posting.google. com>... > I am making a program that categorizes pictures. The picture paths
> are stored in an Access Database, vb6 connects using adodc controls.
> This program works specifically with .jpg files. It will be used by
> people categorizing thousands of images.
>
> The problem I have is that both the picture control, and the image
> control seem unable to open certain jpg images for an unknown reason.
> The error message simply states "Invalid Picture". I can open these
> problem picturesin MS Paint or any other photo editor and the images
> works fine - the problem with the file seems to be limited to the vb6
> controls.
>
> Has anyone else had this problem?
>
> I have made a duct tape solution by identifying what the native jpg
> program is on the user's machine, but can't yet figure out how to run
> that program and load the trouble picture into it. ie: if paint.exe
> is the program associated to .jpg extensions, then open the problem
> image's path in paint.
>
> Does anyone know what the syntax/commands are to do such a thing?
>
> Thanks!!
>
> Trevor

Just a wild shot...

There are different JPG format out, and VB6 isn't exactly new, so it
could be that some newer formats are not supported (you can see the
same problems with some old paint programs).
In this case you might try it using API functions, although I can't
tell you exactly how to do it.
The problem with your "duct tape solution" is that the Shell command
can only run executables, but cannot simulate a double-click on the
file. I know no solution for that, sorry.

Robert


Thanks, Robert. I was working on my 'duct tape' solution last night
and found out that the following command:

Shell "C:\windows\system32\mspaint.exe c:\mypicture.jpg"

will load mypicture.jpg into MS Paint.

Unfortunately, this doesn't work if the path or file name of the jpg
have a space in it.

Shell "C:\windows\system32\mspaint.exe c:\my picture.jpg"

doesn't work because the program is looking for c:\my.bmp...

Shell "C:\windows\system32\mspaint.exe 'c:\my picture.jpg'"

doesn't work either although I don't know why. I have tried square
brackets, and parentheses, and nothing seems to work. Conversely,

c:\windows\system32\mspaint.exe "c:\my picture.jpg"

will work when I go through the 'Run' Command of windows. For some
reason the single quotes don't cut it in this case, perhaps another
limitation of vb6...?

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Tom John | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.