Пример #1
0
#
# See LICENSE.txt file for licensing information
# See CHANGES.txt file for all contributors and changes
#
"""
Runs Exif tag extraction in command line.
"""

import sys
import getopt
import logging
import timeit
from exifread.tags import DEFAULT_STOP_TAG, FIELD_TYPES
from exifread import process_file, exif_log, __version__

logger = exif_log.get_logger()


def usage(exit_status):
    """Show command line usage."""
    msg = (
        'Usage: EXIF.py [OPTIONS] file1 [file2 ...]\n'
        'Extract EXIF information from digital camera image files.\n\nOptions:\n'
        '-h --help               Display usage information and exit.\n'
        '-v --version            Display version information and exit.\n'
        '-q --quick              Do not process MakerNotes.\n'
        '-t TAG --stop-tag TAG   Stop processing when this tag is retrieved.\n'
        '-s --strict             Run in strict mode (stop on errors).\n'
        '-d --debug              Run in debug mode (display extra info).\n'
        '-c --color              Output in color (only works with debug on POSIX).\n'
    )
Пример #2
0
import os
import sys
import getopt
import helper
from file_info import FileInfo
from exif_options import ExifOptions
from exifread import process_file, exif_log, __version__

LOGGER = exif_log.get_logger()


class ImageProcessor:
    def __init__(self):
        self.writes = 0
        self.skipped = 0
        self.errors = 0
        self.no_exif = 0

    def walk_images(self, folder, destination, sort_option, mode):
        """ Execute the main function, limiting to known images with exif format."""
        # Relative or absolute path
        exif_opt = ExifOptions()
        if os.path.isdir(folder):
            count_files = 0

            if mode == 'r':
                for folder, subs, files in os.walk(folder):
                    count = 0
                    if destination not in subs:
                        for file_name in files:
                            if count == 0:
Пример #3
0
# See LICENSE.txt file for licensing information
# See CHANGES.txt file for all contributors and changes
#

"""
Runs Exif tag extraction in command line.
"""

import sys
import getopt
import logging
import timeit
from exifread.tags import DEFAULT_STOP_TAG, FIELD_TYPES
from exifread import process_file, exif_log, __version__

logger = exif_log.get_logger()


def usage(exit_status):
    """Show command line usage."""
    msg = ('Usage: EXIF.py [OPTIONS] file1 [file2 ...]\n'
           'Extract EXIF information from digital camera image files.\n\nOptions:\n'
           '-h --help               Display usage information and exit.\n'
           '-v --version            Display version information and exit.\n'
           '-q --quick              Do not process MakerNotes.\n'
           '-t TAG --stop-tag TAG   Stop processing when this tag is retrieved.\n'
           '-s --strict             Run in strict mode (stop on errors).\n'
           '-d --debug              Run in debug mode (display extra info).\n'
           '-c --color              Output in color (only works with debug on POSIX).\n'
    )
    print(msg)
Пример #4
0
import os
import sys
import getopt
import helper
from file_info import FileInfo
from exif_options import ExifOptions
from exifread import process_file, exif_log, __version__

LOGGER = exif_log.get_logger()


class ImageProcessor:

    def __init__(self):
        self.writes = 0
        self.skipped = 0
        self.errors = 0
        self.no_exif = 0

    def walk_images(self, folder, destination, sort_option, mode):
        """ Execute the main function, limiting to known images with exif format."""
        # Relative or absolute path
        exif_opt = ExifOptions()
        if os.path.isdir(folder):
            count_files = 0

            if mode == 'r':
                for folder, subs, files in os.walk(folder):
                    count = 0
                    if destination not in subs:
                        for file_name in files: