Announcement

Collapse
No announcement yet.

How do I make a thumbnail from a web picture via command line?

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

    How do I make a thumbnail from a web picture via command line?

    Newbie Alert

    I can open the gui and give it some http:/.../xyz.jpg and it opens the picture great and I can do everything with it. Very cool. However when I try it from command line I get an error

    For example

    i_view32.exe "http://ecx.images-amazon.com/images/I/41EA487AP1L._SL500_AA300_.jpg" /resize=(64,48) /aspectratio /convert=c:\test.jpg

    With and without the "''s doesn't matter.

    Gets: http : : Can't read file header.

    If gui can do it, command line should do it.

    Help is greatly appreciated.

    Phillip

    #2
    When you say you "give" some http:/.../xyz.jpg to the GUI, do you mean that you drag an image from your web browser and drop it into the Irfanview window? If so, look at the filename in the caption bar and you will see that what Irfanview has actually opened is a copy of the web image that is sitting in a temp file on your hard drive. Irfanview is not a web browser. It cannot open an image directly from the web. When you drag and drop, the browser tells Windows where that local copy is, and Windows then tells Irfanview where to find it.

    If you try to open a web image from a Command line, Irfanview has no idea where to find that local copy. That is why it does not work.

    Comment


      #3
      Thanks Mij. In particular in Irfanview I go file-open and then give it http://ecx.images-amazon.com/images/...500_AA300_.jpg and it opens it with no issue. I can resize it for example and save it locally.

      But
      i_view32.exe "http://ecx.images-amazon.com/images/I/41EA487AP1L._SL500_AA300_.jpg" /resize=(64,48) /aspectratio /convert=c:\test.jpg

      Which is pointing to the same jpg on the web fails miserably. They should behave identically so I am thinking I am not using the right syntax for the command line.

      Back to you.

      Comment


        #4
        I don't know whether IrfanView lets you open images from the web the way you are attempting to... From your description, it looks like you want to do this to a large number of images...

        I need a few images from the web at a time as well, but my method is to right-click on the image in my Browser, copy and paste it into IrfanView, to resize/ recolor/ edit it. This might not be very useful if you want to convert a number of images in 'one fell swoop', as it were...
        Download IrfanView Help Manual from:
        IrfanView Website - Here
        Sam_Zen's Website - Here
        Author's Website - Here

        Comment


          #5
          Originally posted by pmobin View Post
          Thanks Mij. In particular in Irfanview I go file-open and then give it http://ecx.images-amazon.com/images/...500_AA300_.jpg and it opens it with no issue. I can resize it for example and save it locally.
          Back to you.
          I did not know you could do that, but it is still not Irfanview that is downloading the image from the web, it is Windows that is doing it. The "Open" box that Irfanview displays is a standard dialog called up from the Windows system. It appears that if you paste a URL (Internet address) into it as a file name, then it acts as a hyperlink. Windows calls the Internet Explorer engine which downloads the image to a Temporary Internet file on your computer and then passes that file location to Irfanview. As with the drag and drop method I described in my previous post, you will see the address of that IE temporary internet file in the caption area above your image. That is where Irfanview gets the image from, not direct from the web.

          I find the same thing happens by pasting your jpg URL into the "Open" dialog of almost any program, sometimes with surprising results. Try it in Notepad for instance. My GPS program opens the image of the motor cycle crash helmet and then tries to calibrate it with latitude and longitude coordinates.

          I do not know if there is a way of calling up the IE engine from a Command line and piping the downloaded file to Irfanview. I cannot see how else you could emulate the actions of the GUI.

          Comment


            #6
            My workaround: Use the command line downloader wget in combination with a batch script (saved, for example, as ”picload.cmd”) like the following:
            @echo off
            cls
            setlocal

            set wget=C:\Wget\wget.exe
            set iview=C:\IrfanView\i_view32.exe

            if not "%1"=="" (
            set webpath=%1
            ) else (
            echo.
            echo File to download ^(full path; confirm input by pressing the [Enter] key^):
            set /p webpath=
            )

            for %%a in (%webpath%) do set webfile=%%~nxa

            %wget% -c -N -P "%TEMP%" "%webpath%"
            %iview% %TEMP%\%webfile%

            del %TEMP%\%webfile% /q

            endlocal
            Open a command line window and start the batch script by typing:
            picload.cmd
            or:
            picload.cmd <url>
            'Wget' downloads the specified picture and afterwards 'IrfanView' displays it. If you close the current 'IrfanView' window, the downloaded file will be deleted automatically.

            Attention: This batch script do not work, if the path/filename contains spaces (”%20”).
            »Und so, in eurer Verzweiflung, kommt ihr zu mir.«

            Texteditor EmEditor:
            Deutsche Sprachdatei (v7.01) für EmEditor Pro 7.02 (englisch)
            EmEditor Pro 8.06 (deutsch) | Deutsche Sprachdatei (v8) für EmEditor Pro 8.06 (englisch)
            Deutsche Sprachdatei (v9.16) für EmEditor Pro 9.17 (englisch)

            Comment

            Working...
            X