1
0
mirror of https://github.com/sashacmc/photo-importer.git synced 2024-11-24 08:02:14 +02:00
photo-importer/README.md

124 lines
3.9 KiB
Markdown
Raw Normal View History

2021-01-18 00:18:12 +02:00
# Photo Importer
2021-05-01 00:37:12 +02:00
[![Total alerts](https://img.shields.io/lgtm/alerts/g/sashacmc/photo-importer.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/sashacmc/photo-importer/alerts/)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/sashacmc/photo-importer.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/sashacmc/photo-importer/context:javascript)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/sashacmc/photo-importer.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/sashacmc/photo-importer/context:python)
2018-05-05 18:36:38 +02:00
Command line tools for photo importing/renaming/rotating
2020-03-07 11:00:37 +02:00
### Features:
* Media files scan
* Time when picture was taken detection (by EXIF, by file name, by file attributes)
* Media files moving/copying to configurable hierarchy
2022-11-29 01:44:09 +02:00
* Lossless rotations (via exiftran or jpegtran)
2018-05-07 23:32:00 +02:00
2021-01-18 00:18:47 +02:00
# Photo Importer Server
Standalone web server for fast media import for headless computer
2020-03-07 11:00:37 +02:00
### Features:
* Mounted storages detection (by path mask)
* Storages mount/unmount (via pmount)
* The same as photo-importer but without console
2022-11-29 01:44:09 +02:00
# Installation
### Requirements:
* Python 3.3+
2022-11-29 22:32:04 +02:00
### Supported OS:
* Debian based Linux (other Linux versions not officially supported, but might work)
* Windows 7 and above
* MacOS X and above (with brew installed, only console version)
### Dependencies:
2022-11-29 01:44:09 +02:00
* [PyExifTool](https://pypi.org/project/PyExifTool/)
* [progressbar](https://pypi.org/project/progressbar/)
* [psutil](https://pypi.org/project/psutil/)
* [exiftran](https://linux.die.net/man/1/exiftran) or [jpegtran](https://linux.die.net/man/1/jpegtran)
* [pmount](https://linux.die.net/man/1/pmount) (only for server)
* [pypiwin32](https://pypi.org/project/pypiwin32/) (only for windows)
### Installation Options:
2022-11-29 01:44:09 +02:00
#### Installing via PyPi
```bash
2022-11-29 10:41:50 +02:00
sudo apt install exiftran exiftool pmount pip
2022-11-29 01:44:09 +02:00
sudo pip install photo-importer
```
#### Installing as debian package
```bash
debuild -b
2022-11-29 01:44:09 +02:00
sudo dpkg -i ../photo-importer_1.2.0_all.deb
```
#### Installing via setup.py
```bash
2022-11-29 10:41:50 +02:00
sudo apt install exiftran exiftool pmount pip
2022-11-29 01:44:09 +02:00
sudo pip install PyExifTool progressbar psutil
sudo python3 ./setup.py install
```
2022-01-31 01:12:34 +02:00
#### Installing for Windows
Download and install python3 for you Windows distributive
https://www.python.org/downloads/windows/
Download and install exiftool
https://exiftool.org/
Download and extract jpegtran to photo_importer folder
http://sylvana.net/jpegcrop/jpegtran/
2022-11-29 01:44:09 +02:00
Install with python dependencies
2022-01-31 01:12:34 +02:00
```bash
2022-11-29 01:44:09 +02:00
python -m pip install pypiwin32 photo-importer
2022-01-31 01:12:34 +02:00
```
## Usage
### Command-Line Interface
```bash
photo-importer /path/to/media/files
```
Will process files (reanaming/rotating) in-place.
![In place example](https://user-images.githubusercontent.com/28735879/76139947-bd249780-6055-11ea-85c0-0985b6bde93f.png)
```bash
photo-importer /path/to/media/files /output/path
```
Will import (by default move, but it can be changed in config) files from /path/to/media/files to /output/path with date hierarchy creation and reanaming/rotating
![Move example](https://user-images.githubusercontent.com/28735879/76139964-eba27280-6055-11ea-988f-aa71cda7ba36.png)
2020-03-07 10:44:14 +02:00
### Web Interface
* attach usb-drive / usert memory card
* open http://servername:8080
* click "Mount"
* click "Import"
* click "Unmount"
![Web interface example](https://user-images.githubusercontent.com/28735879/76140174-f1995300-6057-11ea-8718-19c38650c786.png)
2020-03-07 11:06:20 +02:00
2022-01-31 01:12:34 +02:00
### Windows command line
```bash
cd photo_importer
run.py -c ..\photo-importer-win.cfg path\to\media\files \output\path
```
### Windows web
```bash
photo-importer-server.bat
```
2020-03-07 11:06:20 +02:00
## Configuration
2021-01-18 00:18:12 +02:00
The server config file located in /etc/photo-importer.cfg
2020-03-07 11:06:20 +02:00
Command line tool config file located in ~/.photo-importer.cfg
2020-03-07 11:06:20 +02:00
Also config file can be specified by mean of -c command line option.
2021-01-18 00:18:12 +02:00
For options details see comments in the config file.
## Acknowledgements
Thanks to everyone who tested and gave advice.
2021-01-18 00:19:09 +02:00
2021-01-18 00:18:12 +02:00
**Bug reports, suggestions and pull request are welcome!**