ronakg / smart-image-renamer Goto Github PK
View Code? Open in Web Editor NEWA script to intelligently bulk rename images using EXIF data
License: GNU General Public License v2.0
A script to intelligently bulk rename images using EXIF data
License: GNU General Public License v2.0
EXIF knows a tag called Exif.Photo.ImageUniqueID and it would be nice if it would be accessible in this script, eg as {UniqueID}
Maybe it would even be possible to specify how many characters to use from the unique ID?
After installing smart-image-renamer
using pip install smart-image-renamer
on a Windows 10 machine, I get the following error when trying to run it:
$ smart-image-renamer.py -h Traceback (most recent call last): File "c:/Users/XXXX/AppData/Local/Programs/Python/Python36/Scripts/smart-image-renamer.py", line 31, in <module> from _version import __version__ ModuleNotFoundError: No module named '_version'
Just thought you might want to know.
Note:
$ pip install smart-image-renamer Collecting smart-image-renamer Downloading smart-image-renamer-0.3.tar.gz Collecting pillow (from smart-image-renamer) Downloading Pillow-5.0.0-cp36-cp36m-win_amd64.whl (1.6MB) Installing collected packages: pillow, smart-image-renamer Running setup.py install for smart-image-renamer: started Running setup.py install for smart-image-renamer: finished with status 'done' Successfully installed pillow-5.0.0 smart-image-renamer-unknown
Hi,
Is it intentional that the sequence counter resets for different subfolders?
I applied the script on a folder tree with two subfolders, as follows.
SD0
├── 102D3100
│ ├── DSC_0102.JPG
│ ├── DSC_0104.JPG
│ ├── DSC_1199.JPG
│ └── DSC_1968.JPG
└── 103D3100
├── DSC_0105.JPG
└── DSC_0106.JPG
and the output of a test run is as follows
$ ~/repos/misc/smart-image-renamer/smart-image-renamer.py -s 2000 -r -t -f '{Seq}_{File}' SD0
Processing folder: <snip>/SD0
Processing folder: <snip>/SD0/102D3100
DSC_0102.JPG --> 2000_DSC_0102.JPEG
DSC_0104.JPG --> 2001_DSC_0104.JPEG
DSC_1199.JPG --> 2002_DSC_1199.JPEG
DSC_1968.JPG --> 2003_DSC_1968.JPEG
Processing folder: <snip>/SD0/103D3100
DSC_0105.JPG --> 2000_DSC_0105.JPEG
DSC_0106.JPG --> 2001_DSC_0106.JPEG
I'd prefer the sequence counter to keep incrementing, so that in this example the two last files would have been named "2004_…" and "2005_…" respectively.
I just wanted to this module for renaming some of my images. After installing it with PIP and starting it I got the following exception:
MrLeehsMB:~ stefanlehmann$ smart-image-renamer.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/smart-image-renamer.py", line 31, in <module>
from _version import __version__
ImportError: No module named _version
So it seems for me the _version.py is not installed by setup.py. As there is only the version number set maybe it would be better to include it in the module file.
Greetings
If I run the renamer with a destination filename pattern that is not unique for a set of source files, the tool will overwrite target files. For example, if I have three photos taken on the same day and I use the option -f {YYYY}{MM}{DD} then only one of the three files will remain after processing. I know I'd be mad to use that format option, but it's just an example to show the problem. It would be quite possible to have multiple photos taken in the same second, especailly if you are merging photos from multiple photographers or have a DSLR capable of numerous shots per second..
Files shouldn't be overwritten under any circumstances. Perhaps an error or warning could be issued, or maybe have an 'as needed' sequence number that is only applied when the filename is a duplicate of an existing target file.
I realise this problem can be prevented by use of the {Seq} option, but that rather misses the point.
I ran this against several photos and some got renamed with the file extension .MPO. I can manually rename them to .JPEG or . JPG but it renames them again if I run the script against them a second time.
Hi,
Smart Image Renamer is very helpful, but I would be glad to get the Dimension of my photos in order to have a renamed file as below:
2016-myimage-900x600.jpg
I tried to add this:
'Model': exif_data.get('Model', ''),
'Dim1': exif_data.get('XResolution', ''),
'Dim2': exif_data.get('YResolution', ''),
'Folder': os.path.basename(root),
With no success.
Hope you can help me!
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.