File not found issue

Started by deeveon, October 09, 2024, 11:16:12 PM

Previous topic - Next topic

deeveon

Windows 11
CMD
exiftools v12.98 (x64)
app is installed to c:\users\<user>\applications\exiftools
I added that folder to my PATH

I am attempting to strip all metadata except color profile info from pictures in a folder. The folder name has a mix of English & Chinese (Simplified) characters in it, but the filenames do not (just English alphanumeric chars).

Note: I'm not able to paste the Chinese characters from the folder name here, but in English it says "beautiful mountain village".

The command line I'm using is:

exiftool -P -overwrite_original -charset filename=utf8 -all= --ICC_Profile:all <filename>
If the folder is on the same drive as the app (C:), then everything works fine.

If I move the folder to my H: drive and try the same thing, the command fails:

Error: File not found - <filename>
    0 image files updated
    1 files weren't updated due to errors

If I change the folder name (on H:) so it doesn't have Chinese characters in it, then it works fine.

I've ruled out path length by replacing the Chinese folder name with a much, much longer English one.

if I run exiftool without any parameters in that folder (with Chinese chars in the name), I get the following:

Can't spawn "cmd.exe": No such file or directory at C:\Users\<user>\Applications\exiftool\exiftool_files\exiftool.pl line 4651.
Error running more C:\Users\<user>\Applications\exiftool\exiftool_files\windows_exiftool.txt

The only significant difference seems to be the drive the folder is on (i.e. drive letter).


StarGeek

When you are running exiftool from the C: drive, is the current directory the one with Chinese characters? When the file is on the H: drive, have you CDed into that directory or are you using the full path to the file, e.g.
exiftool -all= h:\path\to\<ChineseCharactersDir>

It would be helpful to know the exact command you are using, including the file path.

This sounds like it might be .FAQ #18, problems with special characters on the Windows command line
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

deeveon

I'm not using paths, only filenames. The command is being run inside the folder with the chinese characters. I couldn't get it to work at all using a full path for the filename on either drive.

Here's it working on the C: drive (user profile name redacted).

C:\Users\<user>\Downloads\美丽的山村 (unedited)>exiftool -v1 -P -overwrite_original -charset filename=utf8 -all= --ICC_Profile:all Image-0001.jpg
======== Image-0001.jpg
Rewriting Image-0001.jpg...
  Editing tags in: * AFCP APP0 APP1 APP10 APP11 APP12 APP13 APP14 APP15 APP2 APP3 APP4 APP5 APP6 APP7 APP8 APP9 CIFF COM CanonVRD Comment Ducky ExifIFD FlashPix FotoStation GPS IFD0 IPTC Insta360 ItemList JFIF JUMBF Jpeg2000 Keys MIE MPF MakerNotes Meta MetaIFD Microsoft Nextbase NikonApp NikonCapture PDF PNG PNG-pHYs PhotoMechanic Photoshop PrintIM QuickTime RMETA RSRC Trailer UserData XML XML-* XMP
JPEG APP1 (1658 bytes)
  Deleting IFD0 segment
JPEG APP1 (2432 bytes)
  Deleting XMP segment
JPEG DQT (65 bytes)
JPEG DQT (65 bytes)
JPEG SOF0:
JPEG DHT (29 bytes)
JPEG DHT (179 bytes)
JPEG DHT (29 bytes)
JPEG DHT (179 bytes)
JPEG SOS
    1 image files updated

C:\Users\<user>\Downloads\美丽的山村 (unedited)>

And here's it failing on the H: drive.

H:\Pictures\美丽的山村 (unedited)>exiftool -v1 -P -overwrite_original -charset filename=utf8 -all= --ICC_Profile:all Image-0001.jpg
======== Image-0001.jpg
Error: File not found - Image-0001.jpg
    0 image files updated
    1 files weren't updated due to errors

H:\Pictures\美丽的山村 (unedited)>

It works on the C: drive with code page 437 (default) or 65001. Font didn't matter.

It doesn't work on H: drive regardless of code page or font. I tried many different combinations.

The folder on the H: drive is a copy of the folder on the C: drive so in both cases it's trying to process the same file, eliminating the file as a culprit.

Both drives are formatted using NTFS.

The file owner & security permissions are identical for each. My user account has full control for both.

File attributes for both are normal. (i.e. neither are read only or hidden)

Previously, I made the folder path the same on H: (except the drive letter), eliminating path difference as a culprit.

As near as I can tell, everything is identical except which drive the folder/files are on.

deeveon

I forgot to include a working example on H: without Chinese characters, so here's that. The only difference is I renamed the folder.

H:\Pictures\bmv (unedited)>exiftool -v1 -P -overwrite_original -charset filename=utf8 -all= --ICC_Profile:all Image-0001.jpg
======== Image-0001.jpg
Rewriting Image-0001.jpg...
  Editing tags in: * AFCP APP0 APP1 APP10 APP11 APP12 APP13 APP14 APP15 APP2 APP3 APP4 APP5 APP6 APP7 APP8 APP9 CIFF COM CanonVRD Comment Ducky ExifIFD FlashPix FotoStation GPS IFD0 IPTC Insta360 ItemList JFIF JUMBF Jpeg2000 Keys MIE MPF MakerNotes Meta MetaIFD Microsoft Nextbase NikonApp NikonCapture PDF PNG PNG-pHYs PhotoMechanic Photoshop PrintIM QuickTime RMETA RSRC Trailer UserData XML XML-* XMP
JPEG APP1 (1658 bytes)
  Deleting IFD0 segment
JPEG APP1 (2432 bytes)
  Deleting XMP segment
JPEG DQT (65 bytes)
JPEG DQT (65 bytes)
JPEG SOF0:
JPEG DHT (29 bytes)
JPEG DHT (179 bytes)
JPEG DHT (29 bytes)
JPEG DHT (179 bytes)
JPEG SOS
    1 image files updated

H:\Pictures\bmv (unedited)>

FrankB

I always try adding:

-CHARSET FILENAME=UTF8 -API WindowsWideFile=1
when I have these issues. It may work.

obetz

A wild guess: Maybe Perl needs short filenames, and they are deactivated for H:?

StarGeek

The fact that the command works correctly on the C: drive, but not on the H: drive, indicates that there is something different about the H: drive.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

what happens with another command like "dir" instead of "exiftool"?  ie. dir Image-0001.jpg in the problem directory?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

deeveon

Quote from: FrankB on October 10, 2024, 04:57:47 AMI always try adding:

-CHARSET FILENAME=UTF8 -API WindowsWideFile=1
when I have these issues. It may work.

Adding the -API parameter solved the problem. Thanks!

FrankB


Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

FrankB

Thanks Phil.

I've been using the WindowsWideFile option in ExifToolGui since it was added (Sept. 19, 2023 - Version 12.66) and have yet to observe a problem using it. So if you ask me, it could be the default.
But I would understand if you leave it like it is.

Frank

I remember now our mail conversation, and how it was introduced:
The function EncodeFileName checks for international characters in the relative filename, it doesn't check the current (working) directory for international characters. But opening such a file can still fail.
Especially for network shares, or as Oliver pointed out: Drives that dont support short names.