ExifTool Forum

ExifTool => Developers => Topic started by: refrain on March 28, 2015, 01:27:23 AM

Title: How to hide process of scanning while importing metadata photo?
Post by: refrain on March 28, 2015, 01:27:23 AM
Hi,

I tried to import ExifTool_config in a directory of images then I tried to import csv file into it. But I want to hide the process (like showing information of exif), is there way to hide it?
(http://i59.tinypic.com/307q4n4.png)

and also when i tried to import csv file into metadata photo, I want to hide the failure process while importing them. Because some of data have no sourcefile. then I want to show the details or mention the filename of images which is updated. How can I do this?
(http://i61.tinypic.com/2vvj9ti.png)


I execute those process using shell script and exiftool. I need your help and suggestion. Thanks in advance.  :)

Regards,
Intan
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Phil Harvey on March 28, 2015, 07:17:54 AM
I don't understand exactly, but this seems more like a Linux question (I assume that is what you are running), and not an ExifTool question.

- Phil
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: refrain on March 28, 2015, 09:33:03 AM
Hi Phil,

I execute this script:
exiftool -config ExifTool_config dir
ExifTool_config that I used is to define custom tag like altitude, airspeed, temperature, pressure, roll, pitch and yaw. dir means a directory of images. after i run those code in the terminal, then exiftool will show me exif information of images. I want to hide those process. Can't I?

Then I execute this script to import other data (like gpslatitude, gpslongitude, altitude, airspeed, temperature, pressure, roll, pitch and yaw), which is saved as csv file, to photo like this:
exiftool -csv=test.csv  dir
but if the source file is not match (between sourcefile in csv file and dir), so it will show like this:
No SourceFile '/home/intannd/foto/IMG_0733.JPG' in imported CSV database
(full path: '/home/intannd/foto/IMG_0733.JPG')

I want to hide that too. Can't I?

I hope you understand what I mean. Thank you.

Regards,
Intan
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Alan Clifford on March 28, 2015, 02:04:54 PM
In saying "hide" do you mean not display on the terminal screen?
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Hayo Baan on March 29, 2015, 03:25:52 AM
Have you already tried the -q (quiet) option?
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Phil Harvey on March 29, 2015, 09:08:26 AM
Hi Intan,

You say "hide the process", so my first thought is to make it so that you couldn't see the cpu process with a process monitor (eg. "top"), which I don't think can be done.

Alternatively, perhaps you mean "hide the window", in which case this is likely possible, but it is not an ExifTool question.

Or if you mean "redirect the exiftool output so it doesn't go to the console", then this may certainly be done, and is a shell question.

Finally, as Hayo mentioned, if you mean "suppress exiftool output", then this is an exiftool question, and may be done with -q or -q -q.

- Phil
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: refrain on March 29, 2015, 11:12:39 AM
Quote from: Alan Clifford on March 28, 2015, 02:04:54 PM
In saying "hide" do you mean not display on the terminal screen?
Yeah, that's what i mean. do you have any idea how to do it?

Quote from: Hayo Baan on March 29, 2015, 03:25:52 AM
Have you already tried the -q (quiet) option?
Quote from: Phil Harvey on March 29, 2015, 09:08:26 AM
Finally, as Hayo mentioned, if you mean "suppress exiftool output", then this is an exiftool question, and may be done with -q or -q -q
I have tried the -q or -q -q option like this:
exiftool -config -q ExifTool_config dir or exiftool -config -q -q ExifTool_config dir
but it didn't work as I wish, the output is still shown in the terminal like this:
======== foto/IMG_0695.JPG
ExifTool Version Number         : 9.75
File Name                       : IMG_0695.JPG
Directory                       : foto
File Size                       : 1992 kB
File Modification Date/Time     : 2015:02:17 10:58:48+07:00
File Access Date/Time           : 2015:03:29 21:48:32+07:00
File Inode Change Date/Time     : 2015:03:25 22:24:08+07:00
File Permissions                : rw-------
File Type                       : JPEG
.............etc

I really want to hide those output. do you have any idea?
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Alan Clifford on March 29, 2015, 05:11:08 PM
exiftool photo.jpg > /dev/null

If exiftool writes to stderr as well, you may need this

exiftool photo.jpg &> /dev/null

Title: Re: How to hide process of scanning while importing metadata photo?
Post by: refrain on March 30, 2015, 12:29:22 AM
Quote from: Alan Clifford on March 29, 2015, 05:11:08 PM
exiftool photo.jpg > /dev/null
If exiftool writes to stderr as well, you may need this
exiftool photo.jpg &> /dev/null

Hi, Alan.
I have tried your suggestion, and it works and it can hide all information of images, like exif information of images have been hide and not display in terminal as well. But I want to show the result of details information of scanning images in the terminal, like this:
1 directories scanned
58 image files read


But when i tried to hide of this information:
No SourceFile '/home/intannf/foto/IMG_0662.JPG' in imported CSV database
(full path: '/home/intannf/foto/IMG_0662.JPG')
No SourceFile '/home/intannf/foto/IMG_0736.JPG' in imported CSV database
(full path: '/home/intannf/foto/IMG_0736.JPG')
No SourceFile '/home/intannf/foto/IMG_0770.JPG' in imported CSV database
(full path: '/home/intannf/foto/IMG_0770.JPG')

I think this code exiftool -csv=test.csv dir &> /dev/null or exiftool -csv=test.csv dir > /dev/null don't work, because those failure information is still shown in the terminal. I just need to show the information like this:
1 directories scanned
3 image files updated

and if it's possible, I want to show the details information of images that has been updated,  like this:
/home/intannf/foto/IMG_0771.JPG is updated
/home/intannf/foto/IMG_0777.JPG is updated
/home/intannf/foto/IMG_0779.JPG is updated


Do you have any idea?
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Hayo Baan on March 30, 2015, 03:36:54 AM
To not show any errors, use exiftool options 2>/dev/null
But I think that apart from this, you might need some more filtering. The grep command is your friend here. E.g. like so exiftool options 2>/dev/null | grep "updated\|scanned" to only show lines with updated or scanned in them. If there is error output that contains lines you want, simply redirect the errors to the standard output as well like so: exiftool options 2>&1 | grep "updated\|scanned"

I think this should get you started  :)
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: refrain on April 02, 2015, 02:18:31 AM
Hi, Hayo Baan

Thanks for your helps. I have tried it and it works successfully! I have another problem now.  actually, when I run command to synchronize/import csv file to images in a directory, it will show information like this, for example:
1 directories scanned
3 image files updated

The problem that I have is I want to show the details of images file updated, like this (for example):
1 directories scanned
3 image files updated:
    IMG_111.JPG is updated
    IMG_222.JPG is updated
    IMG_333.JPG is updated

I think if I can show the details of file name of images, it will make us easier to know the image which is updated. Do you have another suggestion? Somebody please help me to find this out. Thanks in advance.

Regards,
Intan
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Phil Harvey on April 02, 2015, 09:33:49 AM
If you add the -v0 to the command then ExifTool will print the name of each file that it processes (to stdout).  All of these files will be updated unless either a "Nothing changed" message is printed (to stdout), or there is an error (to stderr).

- Phil
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: refrain on April 05, 2015, 11:37:16 PM
Quote from: Phil Harvey on April 02, 2015, 09:33:49 AM
If you add the -v0 to the command then ExifTool will print the name of each file that it processes (to stdout).  All of these files will be updated unless either a "Nothing changed" message is printed (to stdout), or there is an error (to stderr).

- Phil

Hi, Phil
I've tried to run command like this:
exiftool -v0 -csv=foto.csv /home/intan/foto 2>&1 | grep "scanned\|updated"

but i only got this message:
1 directories scanned
17 image files updated


the name of each file which is updated is not shown on terminal. Would you mind to explain it more?

Regards,
Intan
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Phil Harvey on April 06, 2015, 08:36:10 AM
Hi Intan,

Try removing your 'grep' so you can see the lines I was talking about.

- Phil
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Alan Clifford on April 06, 2015, 08:58:52 AM
refrain, there is a tutorial on grep and regular expressions at https://www.digitalocean.com/community/tutorials/using-grep-regular-expressions-to-search-for-text-patterns-in-linux (https://www.digitalocean.com/community/tutorials/using-grep-regular-expressions-to-search-for-text-patterns-in-linux)
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: refrain on April 07, 2015, 02:10:23 AM
Quote from: Phil Harvey on April 06, 2015, 08:36:10 AM
Try removing your 'grep' so you can see the lines I was talking about.

Hi, Phil
I've tried as you suggested to me. But this information is still shown in terminal. I want to hide it.
No SourceFile '/home/intannf/foto3/2015_0313_090736_233.JPG' in imported CSV database
(full path: '/home/intannf/foto3/2015_0313_090736_233.JPG')
======== /home/intannf/foto3/2015_0313_090530_194.JPG
No SourceFile '/home/intannf/foto3/2015_0313_090530_194.JPG' in imported CSV database
(full path: '/home/intannf/foto3/2015_0313_090530_194.JPG


I just need the filename of image which is updated to be shown in terminal. do you have any other way to do it?

Regards,
Intan
Title: Re: How to hide process of scanning while importing metadata photo?
Post by: Phil Harvey on April 07, 2015, 06:53:42 AM
Hi Intan,

No, sorry.  There is nothing simple at the ExifTool end that will do what you want.  You should read up on "grep" as Alan suggested.

- Phil