imfinfo doesnt work in R2022b, it's bugged

9 次查看(过去 30 天)
Hello! I am using imfinfo to matlab version R2022b and i get this error:
Failed to create file modification time character vector.
The same function works perfectly in version R2019a.
How can i fix it in version R2022b?
My command is:
x = imfinfo('my_file.tif');
Thanks in Advance
  5 个评论
Jan
Jan 2022-11-22
As said already: Please send this as bug report to MathWorks.

请先登录,再进行评论。

采纳的回答

Steven Lord
Steven Lord 2022-11-22
Since you said imfinfo works for other files but not this one, I'm wondering if the file has somehow been corrupted or if it was written in a non-standard way that imfinfo was lenient enough to allow in the past but is strict enough now (through bug fixes or updates) that it no longer accepts the non-standard file.
First let's check to see if this problem is specific to the .tif file processing code. MATLAB includes one .tif file as part of one of the demos, example.tif. Let's see if imfinfo works on that file. What do you see when you run these lines of code?
name = fullfile(matlabroot, 'toolbox', 'matlab', 'demos', 'example.tif');
S = imfinfo(name);
S(1).FileModDate
ans = '08-Nov-2009 01:02:06'
If that works, then let's see if some other software recognizes this file. What operating system are you using? If you're using Windows, right-click on your my_file.tif in File Explorer and select Properties. In the Properties window for your file, select the Details tab and scroll down to the end of the list, the section with the heading File. What do you see for the "Date created" and "Date modified" entries?
If you see the correct or reasonable data in the Windows properties for the file, let's try one more step. Call imfinfo on your file and let it error. Then run this command and show us what it displays. This will let us see the stack of the error and check whether you've overloaded (or downloaded an overload for) a function upon which imfinfo depends that's preventing it from operating correctly.
ex = MException.last;
result = struct2table(ex.stack)
  10 个评论
DGM
DGM 2022-11-23
编辑:DGM 2022-11-23
I suppose it depends which tags you need to read.
Does geotiffinfo() rely on the same underlying resources as imfinfo()? I have no way of testing this from R2019b, but considering what this file looks like, that might be something to look at.
If nothing else, you might be able to use system('exiftool myfile.tif') or something to get some info as a workaround.
IOANNIS
IOANNIS 2022-11-24
Thank you @DGM !!! geotiffinfo() works perfect in R2022b for these files. I had completely forgotten about this function. Thank you!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by