Announcement

Collapse
No announcement yet.

IrfanView started from external application not browsing other files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    IrfanView started from external application not browsing other files

    Hello!

    I am trying to open IrfanView from within AutoCAD by starting a LISP routine to show an image, but IrfanView only opens the processed image without the ability to browse the previous or next image.
    When using the same parameters in a Batch file everything works fine.

    Example BAT:
    Code:
    start "C:\Path to IrfanView\i_view32.exe" "X:\Some Path\image.jpg"
    Example LISP:
    Code:
    (setq imgpath "X:\\Some Path\\image.jpg")
    (startapp (strcat (chr 34) "C:\\Path to IrfanView\\i_view32.exe " (chr 34) imgpath (chr 34)))
    But why is this happening?

    Any help appreciated.
    Last edited by salvatore; 08.04.2022, 01:00 AM.
    PC: Win10 Pro 64-bit, 250GB SSD, 64GB DDR4 RAM, ASUS GeForce RTX 3060, intel i7 7700k
    Laptop (ThinkPad X1 Yoga): Win10 Pro 64-bit, 512GB, 16GB, i7

    #2
    I'm not familiar with AutoCAD scripting but I see you are using odd number of quotes (chr 34), that doesn't look right to me.
    My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

    Comment


      #3
      Originally posted by JendaLinda View Post
      I'm not familiar with AutoCAD scripting but I see you are using odd number of quotes (chr 34), that doesn't look right to me.
      Ooops, I copied it wrong. Should be:

      Code:
       (startapp (strcat (chr 34) "C:\\Program Files\\IrfanView\\i_view64.exe " (chr 34) " "  (chr 34) imgpath  (chr 34) ))
      PC: Win10 Pro 64-bit, 250GB SSD, 64GB DDR4 RAM, ASUS GeForce RTX 3060, intel i7 7700k
      Laptop (ThinkPad X1 Yoga): Win10 Pro 64-bit, 512GB, 16GB, i7

      Comment


        #4
        This should work. I think the space after exe is unnecessary because you're adding another space between the strings. However this doesn't seem to cause problems in a batch file.

        I would try to run this batch file instead of IrfanView from AutoCAD and look at the output.
        Code:
        echo %0
        echo %1
        pause
        My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

        Comment


          #5
          Originally posted by JendaLinda View Post
          This should work. I think the space after exe is unnecessary because you're adding another space between the strings. However this doesn't seem to cause problems in a batch file.

          I would try to run this batch file instead of IrfanView from AutoCAD and look at the output.
          Code:
          echo %0
          echo %1
          pause
          Erm, I'm not sure if I got you right.

          What should I do with the 3 lines of your code?
          PC: Win10 Pro 64-bit, 250GB SSD, 64GB DDR4 RAM, ASUS GeForce RTX 3060, intel i7 7700k
          Laptop (ThinkPad X1 Yoga): Win10 Pro 64-bit, 512GB, 16GB, i7

          Comment


            #6
            This often happens when a copy of the image is actually stored in temp directory and viewed from there. ACAD may be doing this. JendaLinda's code, if placed in a batch file and called from ACAD, may tell you where the image is actually stored.

            Comment


              #7
              Actually, IrfanView "Image Information" tells you where the image that is being viewed is stored. (see Folder and Full Path) If the path is not your original image location, there probably are no other images in that folder.

              Comment


                #8
                My script tells you the actual paths that AutoCAD is sending. %0 is the path to the script/executable, %1 is the first argument (path to the picture).

                As IrfanUserGuyxyx said, Image Information dialog in IrfanView will tell you the path to the picture as well.
                My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

                Comment


                  #9
                  Originally posted by JendaLinda View Post
                  My script tells you the actual paths that AutoCAD is sending. %0 is the path to the script/executable, %1 is the first argument (path to the picture).
                  As IrfanUserGuyxyx said, Image Information dialog in IrfanView will tell you the path to the picture as well.
                  Originally posted by IrfanUserGuyxyx View Post
                  Actually, IrfanView "Image Information" tells you where the image that is being viewed is stored. (see Folder and Full Path) If the path is not your original image location, there probably are no other images in that folder.
                  When "opening" the image via LISP routine the index is 0/22345 (22k. Yep, there are really that many images) and the full path is correct (P:\SomePath\AnotherPath\Subdir\\img1234567.jpg - names changed due to privacy)
                  PC: Win10 Pro 64-bit, 250GB SSD, 64GB DDR4 RAM, ASUS GeForce RTX 3060, intel i7 7700k
                  Laptop (ThinkPad X1 Yoga): Win10 Pro 64-bit, 512GB, 16GB, i7

                  Comment


                    #10
                    That's weird.

                    I would try to use another batch file to bridge between AutoCAD and IrfanView.
                    Code:
                    start "C:\Path to IrfanView\i_view32.exe" "%~f1"
                    The %~f1 code should normalize the file path in case of something funny happening to it.
                    My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

                    Comment

                    Working...
                    X