No SourceFile '' in imported CSV database

Started by michaelroach, September 09, 2020, 03:17:26 AM

Previous topic - Next topic

michaelroach

Hi,
I have several hundred images that I want to geocode and I have the coordinates for these images in a text file.

I tried to follow the instructions provided in: https://www.propelleraero.com/blog/how-to-batch-geotag-drone-survey-photos-with-exiftool/  and I set up a csv file with all the fields that are apparently required....

I then ran the command line exiftool command:

C:\AAA>exiftool -GPSLatitude -GPSLongitude -GPSAltitude -GPSLatitudeRef -GPSLongitudeRef -GPSAltitudeRef -csv=test.csv -v2 -o ./georef

Exiftool appears to read the data in the csv file because it reports the names and paths to each of the filenames in the first field of the file as shown in the data copied from the command window below:

Imported entry for 'Rossarden13.jpg' (full path: 'c:/aaa/rossarden13.jpg')
Imported entry for 'Rossarden21.jpg' (full path: 'c:/aaa/rossarden21.jpg')
Imported entry for 'Rossarden58.jpg' (full path: 'c:/aaa/rossarden58.jpg')
Imported entry for 'Rossarden37.jpg' (full path: 'c:/aaa/rossarden37.jpg')
Imported entry for 'Rossarden65.jpg' (full path: 'c:/aaa/rossarden65.jpg')
Imported entry for 'Rossarden1.jpg' (full path: 'c:/aaa/rossarden1.jpg')
Imported entry for 'Rossarden46.jpg' (full path: 'c:/aaa/rossarden46.jpg')
Imported entry for 'Rossarden69.jpg' (full path: 'c:/aaa/rossarden69.jpg')
Imported entry for 'Rossarden40.jpg' (full path: 'c:/aaa/rossarden40.jpg')
========
No SourceFile '' in imported CSV database


After listing all the files exiftool then gives the error: No SourceFile '' in imported CSV database

I assumed that there must be an issue with my csv file but I have looked closely at it and cannot find any blank lines or special characters that might be causing this issue.

A dump of the first few lines of the csv file is below:

SourceFile,gpslatitude,gpslongitude,gpsaltitude,gpslatituderef,gpslongituderef,gpsaltituderef
Rossarden1.jpg,41.713457,147.702682,400,S,E,above sea level
Rossarden2.jpg,41.713304,147.702609,400,S,E,above sea level
Rossarden3.jpg,41.71324,147.702896,400,S,E,above sea level
Rossarden4.jpg,41.713059,147.702882,400,S,E,above sea level


I have tried capitalising some of the field names in the csv eg: GPSLatitude but this has no effect.

The files all appear to be in the directory with the csv file and extool as illustrated in the partial listing below. I have tried to reduce the number of entries in the csv file to only one file that I know is in the directory but I still get the same error.

Volume in drive C is OSDisk
Volume Serial Number is 12F0-3BA9

Directory of C:\AAA

09/09/2020  04:44 PM    <DIR>          .
09/09/2020  04:44 PM    <DIR>          ..
28/08/2020  04:44 PM         8,749,130 exiftool.exe
28/08/2020  04:13 PM        13,532,496 Rossarden1.jpg
26/08/2020  09:07 PM        13,160,167 Rossarden2.jpg
26/08/2020  09:09 PM        11,416,346 Rossarden3.jpg
26/08/2020  09:09 PM        12,789,121 Rossarden4.jpg


I am very confused and I guess that there must be something simple that I am missing???
Any suggestions gratefully received.

Regards

Michael

StarGeek

Quote from: michaelroach on September 09, 2020, 03:17:26 AM
I tried to follow the instructions provided in: https://www.propelleraero.com/blog/how-to-batch-geotag-drone-survey-photos-with-exiftool/  and I set up a csv file with all the fields that are apparently required....

I then ran the command line exiftool command:

C:\AAA>exiftool -GPSLatitude -GPSLongitude -GPSAltitude -GPSLatitudeRef -GPSLongitudeRef -GPSAltitudeRef -csv=test.csv -v2 -o ./georef

Most of that command is unnecessary.  None of those gps* arguments are needed as the -csv option uses the tag names from the csv file.  And the -v (verbose) option isn't needed unless you want to see a lot more output, which can be confusing and overwhelming.

The main thing you are missing is the fact that you haven't given exiftool a directory or filename to process.  Exiftool reads in the filenames from the CSV file, but that is just used to match data to the correct file.  You still have to give it files or directories to process.

So try this.
CD to the C:\AAA directory.
Then run this command (a dot at the end to indicate the current directory)
exiftool -csv=test.csv -o ./georef .
This will check every file in C:\AAA to see if there is a match in the CSV file. If there is, it will create a new copy of the file (due to the -o (Outfile) option) in the ./georef directory with the data from the csv file.  The original files will remain unaltered.
"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

michaelroach

Thanks StarGeek,

That worked perfectly - all done.

Michael

sarcha

#3
Hey StarGeek,

I was having the same issue and I ran
(base) C:\AAA>exiftool -csv=ExtractMeta.csv -o ./georef .

but still I am getting the following error


Invalid tag name '[Main]          ExifToolVersion                 : 12.33' in CSV file
No SourceFile './C0008.MP4' in imported CSV database
(full path: 'c:/AAA/c0008.mp4')
No SourceFile './frame0.jpg' in imported CSV database
(full path: 'c:/AAA/frame0.jpg')
No SourceFile './frame1.jpg' in imported CSV database
(full path: 'c:AAA/frame1.jpg')
No SourceFile './frame10.jpg' in imported CSV database
(full path: 'c:/AAA/frame10.jpg')
No SourceFile './frame2.jpg' in imported CSV database
(full path: 'c:/AAA/frame2.jpg')
No SourceFile './frame3.jpg' in imported CSV database
(full path: 'c:/AAA/frame3.jpg')
No SourceFile './frame4.jpg' in imported CSV database
(full path: 'c:/AAA/frame4.jpg')
No SourceFile './frame5.jpg' in imported CSV database
(full path: 'c:/AAA/frame5.jpg')
No SourceFile './frame6.jpg' in imported CSV database
(full path: 'c:/AAA/frame6.jpg')
No SourceFile './frame7.jpg' in imported CSV database
(full path: 'c:/AAA/frame7.jpg')
No SourceFile './frame8.jpg' in imported CSV database
(full path: 'c:/AAA/frame8.jpg')
No SourceFile './frame9.jpg' in imported CSV database
(full path: 'c:/AAA/frame9.jpg')
    1 directories scanned
    0 image files read



Can you please suggest what mistake I am doing and how can I rectify it?

Regards
Sarang

SG edit: changed color output to [code][/code], see text below the post window

StarGeek

#4
Check the paths exiftool displays to make sure the files are there.  For some reason, exiftool can't find the files.   Add the -v2 option to see exactly what exiftool is trying to do.  Post the output for that up to the first file (clip the part from frame0.jpg on).

edit:  Also, please do not double post.
"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

Emma Schultz

Hi StarGeek,

This is my first ExifTool post. I am hesitant to start a brand new post as my question exactly follows the steps from members in this post. Please let me know if I should start a new topic.

I was following the same information as michaelroach was on the PropellerAero site but then found this post when it was not working as expected. I tried the following command that you suggested, with specifying my input file name of course:

exiftool -csv=caminfo_propaero.csv -m -o ./georef .

However, I am getting the following error:
Error: './georef' already exists - ./SEAG00003_184359.JPG
Error: './georef' already exists - ./SEAG00004_184401.JPG

.... etc. etc.

Note: I added the -m option to ignore the 'Warning: [minor] Maker notes could not be parsed'

I tried the -v2 option to give more information. It does appear to read all the images in the directory with the message:

"Imported entry for 'SEAG00047_184527.JPG' (full path: 'c:/exiftool/cam1/seag00047_184527.jpg')
Imported entry for 'SEAG00351_185535.JPG' (full path: 'c:/exiftool/cam1/seag00351_185535.jpg')
etc. etc."


But then gives the 'already exists' error for every image name afterwards:
"======== ./SEAG00002_184357.JPG
Error: './georef' already exists - ./SEAG00002_184357.JPG
======== ./SEAG00003_184359.JPG
Error: './georef' already exists - ./SEAG00003_184359.JPG"


Here is what is in my working directory:
- 500+ .jpg images. All lat/long/altitude data is '0'. I want to add this information to use the images in photogrammetry
- Created a .csv with the correct geotags from the original log .txt file (structured the same as the propelleraero suggestion)
- exiftool.exe

Then I open the Windows command line in the same directory and use the above command.
- Note: After running the command, an undefined file is created in the same directory called "georef" but this is not a folder. Then I get the "georef already exists" error.

Any help would be greatly appreciated. I am scouring through the Forum/ Manual but cannot find the source of this error.

Emma

StarGeek

From the docs on the -o (-out) option
QuoteThe output file is taken to be a directory name if it already exists as a directory or if the name ends with '/'.

Since a file called "georef" is created, that means that a directory doesn't already exist to satisfy the first part.  So if you want the files to be copied to a new directory, either create the new directory first or add a slash to the end of it the directory names used by -o
-o ./georef/
"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

taxesofsyn

I think I'm having the exact same problem. I'm on a Mac. I have the file, captions.csv in the folder, ~/Downloads/imageset, where I also have the ten images listed in the errors below. The CSV file starts like this:

Sourcefile, IPTC:Caption-abstract
Leela0001.jpg, ''
Leela0002.jpg, ''
Leela0003.jpg, ''
Leela0004.jpg, ''
Leela0005.jpg, ''
Leela0006.jpg, '"like putting fish in a barrel"'
Leela0007.jpg, 'raiders of the lost art'
Leela0008.jpg, 'with a little help from my friends'
Leela0009.jpg, 'I can see my country!'
Leela0010.jpg, ''
Leela0011.jpg, 'outré gourmet'
Leela0012.jpg, '"I speak for the fleas"'
Leela0013.jpg, ''

There are actually 1150 images/lines, but I'm testing it out on just the first ten images. As you can see, not every image gets a caption.

In Terminal, I type "pwd" and it verifies that I am in the Downloads folder. I have tried many variations on the following command line. Here are two:

exiftool -csv=/captions.csv ./imageset
exiftool -csv=./imageset/captions.csv /imageset

I keep getting the response below. Help! Thank you.


Reading CSV file /Downloads/captions.csv
Error opening CSV file '/Downloads/captions.csv'
======== ./imageset/Leela0001.jpg
No SourceFile './imageset/Leela0001.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0001.jpg')
======== ./imageset/Leela0003.jpg
No SourceFile './imageset/Leela0003.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0003.jpg')
======== ./imageset/Leela0002.jpg
No SourceFile './imageset/Leela0002.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0002.jpg')
======== ./imageset/Leela0006.jpg
No SourceFile './imageset/Leela0006.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0006.jpg')
======== ./imageset/Leela0007.jpg
No SourceFile './imageset/Leela0007.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0007.jpg')
======== ./imageset/Leela0005.jpg
No SourceFile './imageset/Leela0005.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0005.jpg')
======== ./imageset/Leela0010.jpg
No SourceFile './imageset/Leela0010.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0010.jpg')
======== ./imageset/Leela0004.jpg
No SourceFile './imageset/Leela0004.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0004.jpg')
======== ./imageset/Leela0009.jpg
No SourceFile './imageset/Leela0009.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0009.jpg')
======== ./imageset/Leela0008.jpg
No SourceFile './imageset/Leela0008.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0008.jpg')
    1 directories scanned
    0 image files read

StarGeek

The problem is
Error opening CSV file '/Downloads/captions.csv'
For whatever reason, exiftool can't read the /Downloads/captions.csv file. And because of that, it can't import the CSV data. If the file is at that location, then check the permissions.

Another thing to check is the csv encoding. Make sure it is either ANSI or UTF-8. I don't think this is the problem, as exiftool doesn't return an error if the encoding is UTF-16. It simply ends up with an empty lookup table in that case.
"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

taxesofsyn

Thank you so much. I re-saved the csv file with UTF-8 encoding into Downloads/imageset. Here's the command and response. No more "Error opening CSV file" but I still get the other errors:

alanmuskat@Alans-MacBook-Pro Downloads % exiftool -csv=./imageset/captions.csv ./imageset
No SourceFile './imageset/Leela0001.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0001.jpg')
No SourceFile './imageset/Leela0003.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0003.jpg')
No SourceFile './imageset/Leela0002.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0002.jpg')
No SourceFile './imageset/Leela0006.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0006.jpg')
No SourceFile './imageset/Leela0007.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0007.jpg')
No SourceFile './imageset/Leela0005.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0005.jpg')
No SourceFile './imageset/Leela0010.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0010.jpg')
No SourceFile './imageset/Leela0004.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0004.jpg')
No SourceFile './imageset/Leela0009.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0009.jpg')
No SourceFile './imageset/Leela0008.jpg' in imported CSV database
(full path: '/Users/alanmuskat/Downloads/imageset/Leela0008.jpg')
    1 directories scanned
    0 image files read
 

taxesofsyn

Wait, I think I got it: the FAQ says that in the CSV file, "paths specified in the same way as on the command line" (https://exiftool.org/faq.html#Q26). I did that and now Terminal says:

alanmuskat@Alans-MacBook-Pro Downloads % exiftool -csv=./imageset/captions.csv ./imageset
    1 directories scanned
   10 image files updated

I'm going to go check the files. Hopefully you won't hear from me again! Thanks!!

StarGeek

I should have noticed that at the beginning. Your CSV only has the file name. This would work if you CDed into the directory and used a dot to pass the current directory.

Exiftool was looking for ./imageset/Leela0001.jpg in the CSV file but all you had was Leela0001.jpg.

The -csv option is very picky about what the exact data it is reading.
"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