weird 'file not found' problem when reading metadata for files

Started by vklaffehn, January 01, 2023, 08:16:22 AM

Previous topic - Next topic

vklaffehn

Hello and happy new year!

I have a weird problem using exiftool on windows when trying to read metadata from all files in one folder, or even single files in that folder, but it happens only to some files, NOT to all.

I am using the latest windows version of exiftool (12.52) from Windows 11 terminal (powershell), but the problem is the same running the commands from 'cmd'. It doesnt matter if the images are placed on my linux samba server or on a locally attached USB SSD.

Running a simple
c:\windows\exiftool.exe 'S:\incoming\Minolta Co., Ltd\DiMAGE 7\2002\04\17\Adobe Photoshop 7.0'leads to
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/02_51_55.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/02_56_00.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_06_19.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_06_53.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_10_03.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_13_23.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_31_47.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_53_50.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_54_07.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_55_04.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_55_20.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_55_40.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/04_13_31.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/04_17_55.jpg
    1 directories scanned
    0 image files read
  14 files could not be read

Also this wont work:
c:\windows\exiftool.exe 'S:\incoming\Minolta Co., Ltd\DiMAGE 7\2002\04\17\Adobe Photoshop 7.0\02_51_55.jpg'
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/02_51_55.jpg

And now the weird part:

if I read the contents of the file before, i.e. with
get-content 'S:\incoming\Minolta Co., Ltd\DiMAGE 7\2002\04\17\Adobe Photoshop 7.0\02_51_55.jpg' | out-nullexiftool can read the metadata afterwards :
c:\windows\exiftool.exe 'S:\incoming\Minolta Co., Ltd\DiMAGE 7\2002\04\17\Adobe Photoshop 7.0\02_51_55.jpg'
ExifTool Version Number        : 12.52
File Name                      : 02_51_55.jpg
Directory                      : S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0
File Size                      : 257 kB
...
but only for this one file, so
c:\windows\exiftool.exe 'S:\incoming\Minolta Co., Ltd\DiMAGE 7\2002\04\17\Adobe Photoshop 7.0' -json -freturns data for this file, but can't read the others until i read them also with 'get-content'.
[{
  "SourceFile": "S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/02_51_55.jpg",
  "ExifToolVersion": 12.52,
  "FileName": "02_51_55.jpg",
  "Directory": "S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0",
  "FileSize": "257 kB",
 .....
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/02_56_00.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_06_19.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_06_53.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_10_03.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_13_23.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_31_47.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_53_50.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_54_07.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_55_04.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_55_20.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/03_55_40.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/04_13_31.jpg
Error: File not found - S:/incoming/Minolta Co., Ltd/DiMAGE 7/2002/04/17/Adobe Photoshop 7.0/04_17_55.jpg
}]
    1 directories scanned
    1 image files read
  13 files could not be read

This affects even new opened command shells, where the previously read files can also be processed, but not the rest.

I have no idea why this happens to some files. Copying the files with 'robocopy' doesnt help, copying with windows explorer helps sometimes, opening the folder in windows explorer and set view to thumbnails also helps.

It looks like for some reason 'exiftool' cant open some files on my system, as long as they were not touched in some way by windows.

For now my powershell iterates through my folders and files by itself one by one, reads the first byte and then passes the filename to exiftool. This works, but its not very pretty.

I wonder if there is a problem with my system or if its exiftool's fault ;-)

I cant spot a difference between files that work, and those which doesnt, because looking at the file properties under windows already makes it work....

Hoping for some tipps!


vklaffehn

Well... on my smb share even 'get-content' wont help, only copying the file within the explorer or even using the good old 'copy' will make it work. Very strange.........
-- more info :
even doing a 'cp' on my debian samba server makes it work????? So I would guess its not exiftools fault, but there must be some weird file metadata attached to some files which doesnt get copied.

StarGeek

I'm sorry to say I've never heard of anything like this.  I have my Unraid server set as a network drive and have no problem accessing files on it with exiftool.

The only advice I could offer would be to double check permissions.  Maybe try running the exiftool command from a "run as admin" command line.

The last thing I could suggest would be to see if taking ownership of the files would help.  I use these commands when I have permission problems
takeown /r /d y /f <DIR>
icacls <DIR> /t /grant Everyone:F

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

vklaffehn

Hi and thanks for your feedback!

Permissions are ok, already checked and set as you described, and I can do everything I want with my user account, which also runs exiftool.

I believe there has something weird happened to some not-so-obvious file attributes some time ago. Those files have been moved and copied multiple times between systems with different OS'es, different filesystems and by different ways, i.e. some exiftool-batch processing on linux and windows.
Even looking at the file attributes on the linux server with 'lsattr' I could not see anything wrong.


The reason for me processing these files with a powershell script is that many pictures have strange metadata filled in (weird encoded chars in tags, tag value texts which are way to long, titles, subjects, keywords filled randomly, somteimes with the same text....) so i need some logic to translate them.
After getting problems with identical file and folder names which only difference is upper/lower case text on my samba share I moved my powershell script to the debian fileserver itself where it just runs fine :-)

So I would 'close' my question, but it's still a bit strange that all my programs can use those files without problem, but only exiftool does not want to play along.