Exif renamer mac os

Редактирование exif информации в Mac Os

Привет камрады! В своем первом посте хочу рассказать о своем опыте редактирования метаданных exif изображений jpeg полученных с камеры и правленных в Photoshop.

Дело было так: имелись фотографии сделанные камерой на телефоне, неважного качества. Надо было их почистить, подогнать размер, будто они сделаны фотокамерой, не оставив следов. Вся информация о снимках хранится в EXIF (Exchangeable Image File Format) стандарт, хранящий техническую информацию об изображении, методах его получения, авторстве и т.д. Посмотреть эту информацию можно многими способами, и просто выбрав свойства файла и специальными программами. Но с редактированием дела обстоят сложнее.
После долгих поисков бесплатной программы с GUI, пришлось смириться с отсутсвием таковой и обратить внимание на command-line приложение ExifTool by Phil Harvey Версии есть для всех платформ, устанавливаем необходимую.
Вобщем, долгое и вдумчивое чтения мануала дало понять, что информация франится в тэгах со значением.

Напиример, дата создания файла:
CreateDate: 2010:11:01 10:59:08

Дата правки файла:
FileModifyDate: 2010:11:04 01:10:33

Производитель фотокамеры:
Make: Canon

Модель фотокамеры:
Model: Canon Digital IXUS 970 IS

Всю информацию можно получить набрав в консоли:

exiftool -s IMG_0001.jpg

где IMG_0001.jpg имя редактируемого файла

-s позволяет просмотреть тэги в формате, необходимом для редактирования, т.е убирает пробелы и другие ненужные символы.

Задача стояла убрать все следы работы Photoshop, не стал париться и искать нужные тэги, а просто полностью очистил exif информацию:

exiftool -all= IMG_0001.jpg

Кому нужно- ищите нужный тэг и вписываете необходимую информацию.
Например, инфомация о редакторе:

Software: Adobe Photoshop CS4 Macintosh

Чтобы изменить значение, пишем:

exiftool -Software=«Picasa» IMG_0001.jpg

Если хотите убрать тэг, то ставите пробел после знака «=»

exiftool -Software= IMG_0001.jpg

Далее добавляем производителя фотокамеры:

exiftool -Make=«Canon» IMG_0001.jpg

exiftool -Model=«Canon Digital IXUS 970 IS» IMG_0001.jpg

exiftool -CreateDate=«2010:11:01 11:01:23» IMG_0001.jpg

exiftool -FileModifyDate=«2010:11:01 11:08:12» IMG_0001.jpg

И так далее. Нужные тэги можно подсмотреть в неочищенном файле.
Надеюсь, информация также будет полезна и для пользователей Linux, Windows версий программы.
До новых встречь.

Источник

Exif renamer mac os

Visitors today: 20


Hits to all pages: 7674964

Server-Time: 12:57
2021-10-10

ExifRenamer
2.4.0 (15)

Compatibility information: The current versions of ExifRenamer are fully compatible to macOS «Catalina»!

You know the problem.
You downloaded a ton of new photos from your camera and you get filenames in the following style:

Well, very annoying. You cannot sort your photos by their dates and the naming style also prevents you from creating a large photo library in one folder.
But now there is ExifRenamer!
Just drag&drop the photos on the program icon.

. and get the following result:

The photographs now can be sorted in chronological correct order just by displaying them in alphabetical order. The suggested naming convention is:
YYYY-MM-DD_hh-mm-ss.jpg
The program supports many camera vendors (for example Casio, Olympus, Canon, . ).
Just select ExifRenamer as Automatic Task in «Image Capture».

ExifRenamer allows you to interactively control the renaming process. You can have a file preview and can add a prefix, suffix, change the name or can add a time difference:

Advanced users can enable the advanced configuration mode of ExifRenamer and get access to fully customizable naming styles and much more stuff:

Summary
ExifRenamer is a tool for renaming digital photos, movie- and audio-clips of almost every camera vendor.
ExifRenamer is the perfect tool as auto-action for Apples Image Capture — it can automatically rename the new downloaded pictures without a single mouse click!

The program allows to rename photos by their embedded date+time information in a much more usable way. Most downloaded pictures are named like «pic0001.jpg» or other cryptic names.
ExifRenamer reads the embedded date+time information and renames the picture to for example «2001-11-18_11-16-34.jpg» (YYYY-MM-DD_hh-mm-ss.jpg). This naming style lets you easily create a large photo library with the chance to sort your pictures in chronological order just by displaying it alphabetically sorted in the Finder.
This naming style is recommended as other naming styles mostly dont’t provide this advantage!

ExifRenamer supports both 12h(+AM/PM) and 24h time formats, allows to add a pre- and/or suffix to the filenames (for example «Hawaii 2001-11-18_11-16-34.jpg») and also provides a solution for renaming multiple files with an identical embedded date+time information.

ExifRenamer features since version 2.0 a lot of new features like file preview, fully customizable naming styles, time difference correction, automatic destination folder creation, file deletion, applying a different file creator id, forwarding renamed files to another applications, sequence counters and much more!

The automatic destination folder creation is especially useful for users who do make a lot of pictures. Each time you connect your camera to you computer, a new folder (for example with the name 2002-11-21_0001) is generated and the files are renamed and moved to this folder. This way you have an additional organization in your pictures.

Supported file formats:

  • JPEG-Pictures (.JPG / .JPEG)
  • TIFF-Pictures (.TIFF / .TIF)
  • QuickTime-Videos (.MOV)
  • MPEG4 Videos (.MP4 / .M4V)
  • AVI-Videos (.AVI)
  • Soundfiles (.AIFF / .AIF / .WAV)
  • Minolta Raw Image (.MRW)
  • Nikon Raw Image (.NEF)
  • Canon Raw Image (.CRW — only together with .THM)
  • Canon Raw Image (.CR2)
  • Thumbnails (.THM)

Please note that not all cameras store the required Exif information within the above mentioned file formats; it is possible that ExifRenamer is not able to extract the time and date information in these cases.
In the case of doubts try it with a test file; ExifRenamer in no cases alters the file contents — the only thing changed is the filename itself.
Should ExifRenamer have problems with a certain file format, I’m willing to analyze the format in question; in that case, please give me access to one or more test files.

Use this program on your own risk! I am not responsible for any damage which could be caused by using this program — directly or indirectly.
The program is tested on my machine and works well.

If you like this program, feel free to send me a donation! 🙂

Источник

Exif renamer mac os

No definitions found in this file.

  • Go to file T
  • Go to line L
  • Go to definition R
  • Copy path
  • Copy permalink

Copy raw contents

Copy raw contents

#!/usr/bin/env python
«»»
debian/ubuntu:
apt-get install python3-pip
pip3 install —upgrade pip exifrenamer exiftimestamper
mac os:
sudo easy_install pip
sudo pip install —upgrade pip exifread argparse
«»»
import datetime
import exifread
import exifread . tags
import glob
import os
import platform
import re
import logging
#logging.basicConfig(level=logging.DEBUG)
logging . basicConfig ( level = logging . INFO )
log = logging . getLogger ( __name__ )
WORKING_DIR = ‘.’
# case insensitive file extensions for filtering work dir
JPEG_PATTERNS = (
‘*.gif’ ,
‘*.GIF’ ,
‘*.JPEG’ ,
‘*.jpeg’ ,
‘*.JPG’ ,
‘*.jpg’ ,
‘*.MOV’ ,
‘*.mov’ ,
‘*.MP4’ ,
‘*.mp4’ ,
‘*.PNG’ ,
‘*.png’ ,
‘*.tif’ ,
‘*.tiff’ ,
)
def list_files ( dir_path , file_patterns = JPEG_PATTERNS , recursive = True ):
# recursive search
if recursive is True :
for root , sub_folders , files in os . walk ( dir_path ):
for pattern in file_patterns :
for match in glob . iglob ( os . path . join ( root , pattern )):
if match . startswith ( ‘._’ ):
log . debug ( ‘Skipping file «<0>«‘ . format ( match ))
else :
yield match
# non-recursive
else :
for pattern in file_patterns :
for match in glob . iglob ( os . path . join ( dir_path , pattern )):
if not match . startswith ( ‘._’ ):
yield match
def get_exifdate ( path ):
«»»Read exif time stamp of file, return none if not possible»»»
with open ( path , ‘r’ ) as current_file :
data = exifread . process_file (
current_file ,
stop_tag = ‘EXIF DateTimeOriginal’
)
if data :
try :
ds = data [ ‘EXIF DateTimeOriginal’ ]
except KeyError :
log . debug ( ‘No «EXIF DateTimeOriginal» found in file «<0>«‘ . format ( path ))
return None
else :
try :
return datetime . datetime . strptime ( str ( ds ), «%Y:%m:%d %H:%M:%S» )
except ValueError :
log . debug ( ‘Wrong date format «<0>» in file «<1>«‘ . format (
ds , path
)
)
else :
log . debug ( ‘No exif data found in file «<0>«‘ . format ( path ))
return None
def get_filename_date ( path ):
«»»
in case this file has date info in file name like
«IMG_20180318_152530_2955.JPG», try to get date info from there
«»»
file_name = os . path . basename ( path )
if file_name . startswith ( ‘IMG_’ ):
strings = file_name . split ( ‘_’ )
ds = ‘ ‘ . join ( strings [ 1 : 3 ])
try :
return datetime . datetime . strptime ( str ( ds ), «%Y%m%d %H%M%S» )
except ValueError :
log . debug ( ‘No date information found in file name «<0>«‘ . format ( file_name ))
return None
def get_filestat ( path ):
«»»
Try to get the date that a file was created, falling back to when it was
last modified if that isn’t possible.
See http://stackoverflow.com/a/39501288/1709587 for explanation.
«»»
if platform . system () == ‘Windows’ :
seconds = os . path . getctime ( path )
else :
stat = os . stat ( path )
try :
seconds = stat . st_birthtime
except AttributeError :
# We’re probably on Linux. No easy way to get creation dates here,
# so we’ll settle for when its content was last modified.
seconds = stat . st_mtime
return datetime . datetime . fromtimestamp ( seconds )
def is_datepath ( path ):
«»»Check if filename starts with timestamp, already»»»
first_string = os . path . splitext ( os . path . basename ( path ))[ 0 ]. split ()[ 0 ]
try :
datetime . datetime . strptime ( first_string , «%Y%m%d-%H%M» )
except ValueError :
return False
else :
return True
def get_datepath ( path , date ):
«»»Create new path starting with date info»»»
date_string = date . strftime ( «%Y%m%d-%H%M» )
return os . path . join (
os . path . dirname ( path ),
‘ <0><1>‘ . format ( date_string , os . path . basename ( path ))
)
for path in list_files ( WORKING_DIR ):
# retrieve new file name, if necessary
if is_datepath ( path ):
log . info ( ‘file «0<>» looks good, already’ . format ( path ))
continue
else :
# retrieve date of media file — exif or file creation
date = get_exifdate ( path )
if date and date is not 0 :
log . info ( ‘»<1>» from exif data in «<0>«‘ . format ( path , date ))
else :
date = get_filename_date ( path )
if date and date is not 0 :
log . info ( ‘»<1>» from date info in file name of «<0>«‘ . format ( path , date ))
else :
date = get_filestat ( path )
log . info ( ‘»<1>» from file stat data of file «<0>«‘ . format ( path , date ))
new_path = get_datepath ( path , date )
# rename file
log . debug ( ‘renaming file to «<>«‘ . format ( os . path . basename ( new_path )))
os . rename ( path , new_path )

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Читайте также:  Настройка kerberos windows 2012 r2
Оцените статью