필터 지우기
필터 지우기

Why did imread() stop working when I changed to 2019a?

조회 수: 1 (최근 30일)
Chuck37
Chuck37 2020년 3월 10일
편집: Chuck37 2020년 3월 11일
I have been using imread to get images from a server by putting requests into the URL argument: im = imread(url). Now I'm getting an error "Can't read URL, ..., Reason: first input must be 1xN cell array of strings." What is it talking about?
EDIT: I wasted everyone's time with this. After digging deeper, I found that I had an old version of strjoin() in my path somehow. The function must have changed in a critical way. Problem disappeared when I removed this old version.
  댓글 수: 2
Chuck37
Chuck37 2020년 3월 10일
I believe that this is not due to going to 2019a, but related to recent permission lockdowns on /tmp directory (linux). I need to figure out how to point matlab to a different temp directory to test this.
Chuck37
Chuck37 2020년 3월 10일
Nevermind. I still don't know what's going on.

댓글을 달려면 로그인하십시오.

답변 (1개)

Steven Lord
Steven Lord 2020년 3월 10일
Can you show us the class and size of the url variable you're passing into imread?
Is it a character vector or a string scalar as the documentation page for the imread function indicates it needs to be? See the section describing the Input Arguments, specifically the filename input argument.
  댓글 수: 3
Image Analyst
Image Analyst 2020년 3월 10일
It looks like that would not give a simple filename, but possibly a list of a whole bunch of filenames. I suggest you somehow use webread() to execute that query and then parse out the filenames one at a time.
Chuck37
Chuck37 2020년 3월 10일
편집: Chuck37 2020년 3월 10일
No, it just gives back one jpeg file. It used to work just fine (for years). I jumped from 2016a to 2019a.
I was experimenting and webread gives the same error anyway. I can't say I understand why there is so much code to rip the URL into pieces and glue it back together. webread does the same.
EDIT: urlread functions without error, but it just gives me a character vector, presumably raw jpeg bytes, which isn't all that helpful and would require a bit of workaround to make into pixels.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by