imfinfo doesnt work in R2022b, it's bugged

9 vues (au cours des 30 derniers jours)
IOANNIS
IOANNIS le 22 Nov 2022
Commenté : IOANNIS le 24 Nov 2022
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 commentaires
IOANNIS
IOANNIS le 22 Nov 2022
File:my_file.tif size exceeds 5 MB.
Jan
Jan le 22 Nov 2022
As said already: Please send this as bug report to MathWorks.

Connectez-vous pour commenter.

Réponse acceptée

Steven Lord
Steven Lord le 22 Nov 2022
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 commentaires
DGM
DGM le 23 Nov 2022
Modifié(e) : DGM le 23 Nov 2022
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 le 24 Nov 2022
Thank you @DGM !!! geotiffinfo() works perfect in R2022b for these files. I had completely forgotten about this function. Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by