I do
wget http://services.runescape.com/m=itemdb_rs/3809_obj_sprite.gif?id=2
and it downloads the following file:
3809_obj_sprite.gif?id=2
How can I make it save as the following?
2.png
Why does
|
|
I have no idea why this has so many up votes, because the URL you posted is for a .gif file, changing the file name to 2.png will not magically make that .gif a .png. Either way an image is a file, everything saved anywhere is a file even directories are actually stored on filesystems as files. – Jarrod Roberson Aug 4 '12 at 22:30 |
||
|
Jarrod, I now updated my answer and explicitly addressed what probably was a misunderstanding by the OP. As for you asking why this answer had so many up votes – are you inferring it should have been downvoted because I gave the OP wrong information? I never claimed that an image was not a file and that a GIF would magically turn into a PNG when renamed. I assumed it was a typo since the focus of the question was the file name. – slhck♦ Aug 4 '12 at 23:02 |
||
|
This is simply because look at the path, it ends in ?id=2, therefore it will save as this, you can move the file or use the -O parameter to define a file name. |
|||
|
|
|
There is the command line option My debian squeeze box it says the option is "experimental" though... |
|||
|
If the file you direct wget to download for you is indeed an image, then what it downloads is an image. wget doesn't bother to guess the correct file name and extension, it uses what it finds in the URL e.g |
|||
|
|
|
Also, with
|
|||||
|
|
wgetdoes not do image conversion. Saving a GIF file with a .png extension does not turn it into a PNG file. You'll want to save the file with the proper extension (in this case, .gif), and use image manipulation software to convert it to a different format. – Indrek Aug 4 '12 at 16:17