tqjustc
tqjustc

Reputation: 3814

How to save an image using its URL in Matlab

I have a problem to save an image with its URL. I once used URLWRITE function. it works well for most of image urls. However, for this one: http://www.freegreatpicture.com/files/157/1562-cute-little-cat.jpg , I cannot save this image to my disk using urlwrite(url, 'cat.jpg'); . Anyone can help ? Thanks !

PS. the saved image cannot be opened. After I click the url, the image is as this: enter image description here

Upvotes: 1

Views: 2470

Answers (1)

tomdelahaba
tomdelahaba

Reputation: 1048

Problem will be with that sites and the url forwarding due MVC i guess. If you click at your link, you dont get the exact image. You get the sites where you need to click at the download button and wait 10 or how much seconds. Probably if you get the IMAGE link.. you will have no problems. But you dont in here. Its not problem of your script or in urlwrite function it is "problem" (probably intention) of that sites

Upvotes: 1

Related Questions