• Error importing pictures

    By Ronald Veldhuizen 2 decades ago

    Sorry, I posted this one under discussion, so I post it her again:



    Post 1:



    Hy,



    I've installed and configured the ONPD, installed the Easy Thumbnails.

    When I'm trying to import picture in an test album I get the error: File Not Found.

    Not quit sure, but I think ET can't be found?

    Thanks in advance for helping me out!



    Ronald



    Post 2:



    Some more info: Running both v. 6.5.1, workstation os= W2k.

    I am not good in scripting, but as far as I can figure it out it goes wrong after the next comment:



    'now copy the image so we can fix the size and continue.



    I think that the the wrong path is being used for importing the picture?

    Cause when I read out the ONPD_Temp + "\" + doc.PermaLink(0) + "." + ONPD_OrgImageExt,

    I get the next : %SystemRoot%/Temp/RVEN-5XREHR.jpg

    This is( I guess again) the temp file name? Shouldn't it be pointed to the original file ?



    Ronald

    • temp

      By Christian Brandlehner 2 decades ago

      ' now copy the image so we can fix the size and continue.

          in_image = ONPD_Temp + &quot;\&quot; + doc.PermaLink(0) + &quot;.&quot; + ONPD_OrgImageExt<br/>
          out_image = ONPD_Temp + &quot;\&quot; + doc.PermaLink(0) + &quot;.jpg&quot;<br/>
          Filecopy filelist,in_image<br/>
      



      The code is OK at this point as what we are doing here is not as complicate as it seems first. "filelist" contains the path and filename of the file to be imported. As the original filenames showed to be a problem (blanks and other special characters in filenames) I am creating a 1:1 copy of the image in the temp directory. The filename is computed from the Permaling plus the extension.

      The problem you are reporting is with EZThumbs ignoring system variables. So for example %systemroot% is not translated to "C:\winnt\", it just causes an error.



      Christian

      • Not quiet so, I guess

        By Ronald Veldhuizen 2 decades ago

        Just wandering about EZT, because before we come to the EZT, aan error is occuring. After some debugging the problem seems to be the %SytemRoot%. Under W2k when you enter in a cmd box the next command:



        copy d:\test\1.jpg %SytemRoot%\Temp\1.jpg



        you wil get the error: The system cannot find the path specified.



        The problem here is everything after the second %. Leaving the \Temp\1.jpg results in a copy into c:\Winnt (in my case).

        When C:\Winnt\Temp hardcoded like ONPD_Temp="C:\Winnt\Temp" the actual temp picture is being created in the directory. A notes document is being created, but then the next error occures:

        Path/File access error.

        • This is what I found

          By Mac Sokulski 2 decades ago

          I had to make some changes to the PictureImport script and that finally got the import to work quite nicely. Here is what I did. Instead of %systemroot% path, which for some reason is creating the problem, I set the script to use the EZT directory as the temporary storage for files. This is the line I used:

          Const TEMPNotesMacro = |@RegQueryValue("HKEY_LOCAL_MACHINE"; "Software\Microsoft\Windows\CurrentVersion\App Paths\EzThumbs.exe"; "Path")|



          The path/file access error is generated by a KILL command in the script. Look in the IMPORT section of the PictureImport Script library.

          Lines 10 and 11 (counting from the end/bottom).



          Kill in_image

          Kill out_image



          If you import a JPG file. The temporary file is delete by the first line Kill in_image. Since that file is gone the line kill out_image produces an error, because there is nothing to delete. Also this is why only the last image out of multiple images get's imported, because the list of files is being processed from the last file.

          What I have done is rem'ed out the kill out_image, and for my purposes it works like a charm. Now this is not a solution for everyone. Because if you are importing a TIFF file (or a file with a different extension than jpg), you will have two temporary files with different extensions, and only one of them will get deleted at the end. Forcing you to do a manual clean up of the temporary directory.

          Since I only imported JPG, this works for me, but it might now work properly if you import something else than JPG.



          Hope this helps.



          Mac

          • Re: It works thanks for helping me out ! <EOM>

            By Ronald Veldhuizen 2 decades ago
          • By Oliver Regelmann 2 decades ago

            For the Kill problem try this code:



            If FileExists(in_image) = 1 Then

            Kill in_image

            End If

            If FileExists(out_image) = 1 Then

            Kill out_image

            End If

            • Tried the code, worked ok,Thanks! <EOM>

              By Ronald Veldhuizen 2 decades ago
      • Not quiet so, I guess

        By Ronald Veldhuizen 2 decades ago

        Just wandering about EZT, because before we come to the EZT, aan error is occuring. After some debugging the problem seems to be the %SytemRoot%. Under W2k when you enter in a cmd box the next command:



        copy d:\test\1.jpg %SytemRoot%\Temp\1.jpg



        you wil get the error: The system cannot find the path specified.



        The problem here is everything after the second %. Leaving the \Temp\1.jpg results in a copy into c:\Winnt (in my case).

        When C:\Winnt\Temp hardcoded like ONPD_Temp="C:\Winnt\Temp" the actual temp picture is being created in the directory. A notes document is being created, but then the next error occures:

        Path/File access error.

        • More then one picture

          By Ronald Veldhuizen 2 decades ago

          When you select more then one picture, only the last selected will be put into a document.