How to save an image using its URL

7 ビュー (過去 30 日間)
Arthur Melo
Arthur Melo 2014 年 10 月 16 日
I did this steps and it didn't worked!
url_img =
name_file_img =
20141015-00:00.jpg
>> urlwrite(url_img, name_file_img); Error using urlreadwrite>getFileOutputStream (line 245) Could not open output file "C:\Users\Albm\Documents\MATLAB\2014\10\15\2014\10\15\2014\10\15\2014\10\15\20141015-00:00.jpg".
Error in urlreadwrite (line 69) [file,outputStream] = getFileOutputStream(inputs.filename);
Error in urlwrite (line 38) [f,status] = urlreadwrite(mfilename,catchErrors,url,filename,varargin{:});

採用された回答

matt dash
matt dash 2014 年 10 月 17 日
You just can't have a colon in a file name, that's all.
  2 件のコメント
Star Strider
Star Strider 2014 年 10 月 17 日
Good pick-up!
I completely overlooked that.
Arthur Melo
Arthur Melo 2014 年 10 月 17 日
Thanks everybody and sorry, but matt dash gave me the perfect answer, some times we forget too basics things. I don't know why. Thank you matt, now I have no problem.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2014 年 10 月 17 日
You need to use imwrite() if you want to save an image, not urlwrite().
  4 件のコメント
Image Analyst
Image Analyst 2022 年 2 月 11 日
To get no additional losses, use PNG format
imwrite(rgbImage, 'satellite image.png');
Can you show an example of how you'd save your image array with urlwrite()? The documentation only shows how to save web pages as HTML format, not how to save image data in PNG format.
Augusto Gabriel da Costa Pereira
Augusto Gabriel da Costa Pereira 2022 年 11 月 11 日
This code is perfect. Thanks @Image Analyst

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCommunications Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by