Picture Problem - jpg won't load

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Trevor Fairchild

    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
  • Asperamanca

    #2
    Re: Picture Problem - jpg won't load

    trevorf@e-crime.on.ca (Trevor Fairchild) wrote in message news:<5bf84afd. 0308121236.1ff1 d3f6@posting.go ogle.com>...[color=blue]
    > 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[/color]

    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

    Comment

    • Stephane Richard

      #3
      Re: Picture Problem - jpg won't load

      not really no Trevor,

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

      SHELL "C:\Windows \
      Shell "C:\windows\sys tem32\mspaint.e xe " & 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

      For all your hosting and related needs
      "Trevor Fairchild" <trevorf@e-crime.on.ca> wrote in message
      news:5bf84afd.0 308130825.614d2 2a@posting.goog le.com...[color=blue]
      > asperamanca@yah oo.com (Asperamanca) wrote in message[/color]
      news:<3bf3b2f5. 0308130029.4fca 9e5b@posting.go ogle.com>...[color=blue][color=green]
      > > trevorf@e-crime.on.ca (Trevor Fairchild) wrote in message[/color][/color]
      news:<5bf84afd. 0308121236.1ff1 d3f6@posting.go ogle.com>...[color=blue][color=green][color=darkred]
      > > > 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[/color]
      > >
      > > 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[/color]
      >
      > Thanks, Robert. I was working on my 'duct tape' solution last night
      > and found out that the following command:
      >
      > Shell "C:\windows\sys tem32\mspaint.e xe c:\mypicture.jp g"
      >
      > 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\sys tem32\mspaint.e xe c:\my picture.jpg"
      >
      > doesn't work because the program is looking for c:\my.bmp...
      >
      > Shell "C:\windows\sys tem32\mspaint.e xe '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\syst em32\mspaint.ex e "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...?[/color]


      Comment

      • Trevor Fairchild

        #4
        Re: Picture Problem - jpg won't load

        It worked exactly like it should! Thank you very much for your help.

        "Stephane Richard" <stephane.richa rd@verizon.net> wrote in message news:<DQv_a.821 2$u%2.6955@nwrd ny02.gnilink.ne t>...[color=blue]
        > not really no Trevor,
        >
        > What you can do in VB is concatenate quotes..such as
        >
        > SHELL "C:\Windows \
        > Shell "C:\windows\sys tem32\mspaint.e xe " & 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" <trevorf@e-crime.on.ca> wrote in message
        > news:5bf84afd.0 308130825.614d2 2a@posting.goog le.com...[color=green]
        > > asperamanca@yah oo.com (Asperamanca) wrote in message[/color]
        > news:<3bf3b2f5. 0308130029.4fca 9e5b@posting.go ogle.com>...[color=green][color=darkred]
        > > > trevorf@e-crime.on.ca (Trevor Fairchild) wrote in message[/color][/color]
        > news:<5bf84afd. 0308121236.1ff1 d3f6@posting.go ogle.com>...[color=green][color=darkred]
        > > > > 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[/color]
        > >
        > > Thanks, Robert. I was working on my 'duct tape' solution last night
        > > and found out that the following command:
        > >
        > > Shell "C:\windows\sys tem32\mspaint.e xe c:\mypicture.jp g"
        > >
        > > 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\sys tem32\mspaint.e xe c:\my picture.jpg"
        > >
        > > doesn't work because the program is looking for c:\my.bmp...
        > >
        > > Shell "C:\windows\sys tem32\mspaint.e xe '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\syst em32\mspaint.ex e "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...?[/color][/color]

        Comment

        Working...