phtools 0.15.1 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38105ed36855c6951006e4d016300abeb71376c8
4
- data.tar.gz: 3147aeae28704093e02c36e7acf46c7d1ad6389c
3
+ metadata.gz: f37bf58f801dd2e2dae773bf219c3b28357d6ad2
4
+ data.tar.gz: 67a33c3205c22f9980201562b70bee2641ce21e6
5
5
  SHA512:
6
- metadata.gz: dc5692669197d8c219c463f107370cf040d5202a74ac78a69742b940316859a4b1a3f644ee4bb5c4959f241087a0490f1a74d1c9db362f3d879a97e68c8bcec3
7
- data.tar.gz: 0276417d4fe7e2767a20712dca41d67a52f18356bcdf3783e4e1ed8c250d711f7875933f4ba0fd6f1fcc5539849135fad8a81a4536b3d8146f4f09f1fe7c3967
6
+ metadata.gz: 5c8a23354bdb69ee63c15975cdd0d7b386eb5664be43bc5630eeb8d36a393c58372e86955f49d149feff8523962bd91015f9d32296b18983353760fb3f318a75
7
+ data.tar.gz: 99628b863d8cff4a26d40b8f3bcda46e07b5522eeafc3fe93688e40e492d27a9e84e87546888155baa4790d67c7e42fe7b89c5fc247977213e0aa09318777f92
data/History.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # RELEASED
2
2
 
3
+ ## [v0.16.0](https://github.com/andrewbiz/phtools/compare/v0.15.0...v0.16.0)
4
+ * phtools now support Apple HEIC image file format (as exiftool it can only read tags)
5
+
3
6
  ## [v0.15.0](https://github.com/andrewbiz/phtools/compare/v0.14.0...v0.15.0)
4
7
  * phls now supports --range parameter allowing the user to filter files which name endings are not in the given range
5
8
 
data/README.md CHANGED
@@ -1,61 +1,74 @@
1
1
  [![Version ](https://img.shields.io/gem/v/phtools.svg?style=flat)](https://rubygems.org/gems/phtools)
2
+
2
3
  # PHTOOLS by ANB
4
+
3
5
  A bundle of small CLI tools for arranging, renaming, tagging of the photo and video files. Helps to keep photo-video assets in order.
4
6
 
5
7
  ## Rationale
8
+
6
9
  PHTOOLS is an instrument intended for photographers\photo enthusiasts who:
10
+
7
11
  * own tons of photo-video files and want to keep it in order
8
- * really don't like the way how digital cameras name the files: P1193691.JPG, IMP_1409.JPG, \_DSC1459.ARW etc.
9
- * for photo storage prefer usage of traditional File System (folder structure) instead of "black box" databases of media managers (like iPhoto, Photoshop etc.)
12
+ * really don't like the way how digital cameras name the files: P1193691.JPG, IMP\_1409.JPG, \_DSC1459.ARW etc.
13
+ * for photo storage prefer usage of traditional File System \(folder structure\) instead of "black box" databases of media managers \(like iPhoto, Photoshop etc.\)
10
14
  * would like to have date-time-original info in the name of the file
11
15
  * expects that sorting folder content "by name" will arrange photo-video assets in chronological order
12
- * for some events (wedding, holydays etc.) have photos from different authors and would like to keep visible author name (nik) in the file name
13
- * appreciate the use of internal metadata (EXIF, XMP etc.) beleiving it is the best way to keep context info of the picture
16
+ * for some events \(wedding, holydays etc.\) have photos from different authors and would like to keep visible author name \(nik\) in the file name
17
+ * appreciate the use of internal metadata \(EXIF, XMP etc.\) beleiving it is the best way to keep context info of the picture
14
18
  * are Ok with the use of Command Line tools
15
19
 
16
- **********
20
+ ---
17
21
 
18
22
  ## Installation
23
+
19
24
  ### Install for usage
20
- 1. Get the latest [ruby](https://www.ruby-lang.org/) (>= 2.3) installed.
21
- 2. Install ExifTool by Phil Harvey (http://www.sno.phy.queensu.ca/~phil/exiftool/).
25
+
26
+ 1. Get the latest [ruby](https://www.ruby-lang.org/) \(>= 2.4\) installed.
27
+ 2. Install ExifTool by Phil Harvey \([http://www.sno.phy.queensu.ca/~phil/exiftool/](http://www.sno.phy.queensu.ca/~phil/exiftool/)\).
22
28
  3. `gem install phtools`
23
29
  4. Get list of phtools: `phtools`
24
30
  5. Get usage info for particular command: `phls -h`
25
31
 
26
32
  ### Install for development
33
+
27
34
  1. Fork or download from GitHub.
28
35
  2. Install dependencies: `bundle install`
29
36
  3. Develop.
30
37
  4. Test:
31
- ```sh
32
- bundle exec rspec
33
- bundle exec cucumber
34
- ```
35
- ... or do testing automatically to get real Test Driven Development:
36
- ```sh
37
- bundle exec guard
38
- ```
38
+ ```sh
39
+ bundle exec rspec
40
+ bundle exec cucumber
41
+ ```
42
+
43
+ ... or do testing automatically to get real Test Driven Development:
44
+ ```sh
45
+ bundle exec guard
46
+ ```
39
47
 
40
- **********
48
+ ---
41
49
 
42
50
  ## PHTOOLS Use cases
43
51
 
44
- ### USE CASE 1. Collect photos, videos, raw-photos from different sources into one place (for further processing)
52
+ ### USE CASE 1. Collect photos, videos, raw-photos from different sources into one place \(for further processing\)
53
+
45
54
  #### Given
55
+
46
56
  I have copies of SD Cards with photos, videos taken with DSLR camera on my Hard Disk in `~/Desktop/SDCard1` and in `~/Desktop/SDCard2`.
47
57
 
48
- And I have empty folder `~/Desktop/assets_staging` (lets call it _working folder_).
58
+ And I have empty folder `~/Desktop/assets_staging` \(lets call it _working folder_\).
49
59
 
50
- And I want all the photo-video files from SD copies (including ones placed deep inside the folder structure of the SD card) to be moved to the _working folder_.
60
+ And I want all the photo-video files from SD copies \(including ones placed deep inside the folder structure of the SD card\) to be moved to the _working folder_.
51
61
 
52
62
  #### When
63
+
53
64
  I run:
65
+
54
66
  ```sh
55
67
  phls -R ~/Desktop/SDCard1 ~/Desktop/SDCard2 | phmove -a ~/Desktop/assets_staging
56
68
  ```
57
69
 
58
70
  #### Then
71
+
59
72
  I get all photos moved to `~/Desktop/assets_staging`.
60
73
 
61
74
  And all videos are moved to `~/Desktop/assets_staging/VIDEO`.
@@ -66,20 +79,25 @@ And all raw photo-files are moved to `~/Desktop/assets_staging/RAW`.
66
79
 
67
80
  ### USE CASE 2. Renaming files in accordance with PHTOOLS standard
68
81
 
69
- #### USE CASE 2.1 Mass rename photos in accordance with PHTOOLS standard (and don't forget to backup before)
82
+ #### USE CASE 2.1 Mass rename photos in accordance with PHTOOLS standard \(and don't forget to backup before\)
83
+
70
84
  #### Given
85
+
71
86
  I have dozens of photo-files in my working folder `~/Desktop/assets_staging`.
72
87
 
73
- And my friend Alex it the author of the photos (nikname ALX).
88
+ And my friend Alex it the author of the photos \(nikname ALX\).
74
89
 
75
90
  #### When
91
+
76
92
  I run:
93
+
77
94
  ```sh
78
95
  cd ~/Desktop/assets_staging
79
96
  phls | phbackup | phrename -a alx
80
97
  ```
81
98
 
82
99
  #### Then
100
+
83
101
  I get all photos in `~/Desktop/assets_staging` renamed according to PHTOOLS standard.
84
102
 
85
103
  And I have all original photo-files are backed-up to `~/Desktop/assets_staging/backup`.
@@ -87,72 +105,90 @@ And I have all original photo-files are backed-up to `~/Desktop/assets_staging/b
87
105
  ==========
88
106
 
89
107
  #### USE CASE 2.2 Rename photos back to it's original names
108
+
90
109
  #### Given
110
+
91
111
  I have several photo files in my working folder `~/Desktop/assets_staging` renamed to PHTOOLS standard.
92
112
 
93
- And I want to get all the files renamed back to it's original names (given by DSLR camera)
113
+ And I want to get all the files renamed back to it's original names \(given by DSLR camera\)
94
114
 
95
115
  #### When
116
+
96
117
  I run:
118
+
97
119
  ```sh
98
120
  cd ~/Desktop/assets_staging
99
121
  phls | phrename --clean
100
122
  ```
101
123
 
102
124
  #### Then
125
+
103
126
  I get all photos in `~/Desktop/assets_staging` renamed to it's original names.
104
127
 
105
128
  ==========
106
129
 
107
130
  #### USE CASE 2.3 Change author nickname in the filenames
131
+
108
132
  #### Given
109
- I have several photo files in my working folder `~/Desktop/assets_staging` renamed to PHTOOLS standard. Some photos were made by ANB, some photos were made by Alex (nick _ALE_)
133
+
134
+ I have several photo files in my working folder `~/Desktop/assets_staging` renamed to PHTOOLS standard. Some photos were made by ANB, some photos were made by Alex \(nick _ALE_\)
110
135
 
111
136
  And I want to change the author NICKNAME _ALE_ to _ALX_.
112
137
 
113
138
  #### When
139
+
114
140
  I run:
141
+
115
142
  ```sh
116
143
  cd ~/Desktop/assets_staging
117
144
  phls '*ALE*'| phrename -a alx
118
145
  ```
119
146
 
120
147
  #### Then
148
+
121
149
  I get all _ALE_ photos in `~/Desktop/assets_staging` renamed to _ALX_ nickname.
122
150
 
123
151
  And all _ANB_ photos are kept unchanged.
124
152
 
125
- _Note. `phrename` is smart enough to let the user to re-run it several times on one file. Every time `phrename -a` re-runs it only overwrites author nickname (if it is different) keeping date-time-in-the-name unchanged._
153
+ _Note. _`phrename`_ is smart enough to let the user to re-run it several times on one file. Every time _`phrename -a`_ re-runs it only overwrites author nickname \(if it is different\) keeping date-time-in-the-name unchanged._
126
154
 
127
155
  ==========
128
156
 
129
157
  #### USE CASE 2.4 Adjust date-time in the filename
158
+
130
159
  #### Given
160
+
131
161
  I have several video files taken by iPhone in my working folder `~/Desktop/assets_staging` renamed to PHTOOLS standard.
132
162
 
133
- And I've found out that iPhone gives the wrong value to CreateDate tag (in my case the error is minus 2 hours to real time of creation). Because of that 'phrename' gives the wrong _YYYYmmdd-HHMMSS_ timestamp in the filename. I want to get the correct date-time info in the names of video files.
163
+ And I've found out that iPhone gives the wrong value to CreateDate tag \(in my case the error is minus 2 hours to real time of creation\). Because of that 'phrename' gives the wrong _YYYYmmdd-HHMMSS_ timestamp in the filename. I want to get the correct date-time info in the names of video files.
134
164
 
135
165
  #### When
166
+
136
167
  I run:
168
+
137
169
  ```sh
138
170
  cd ~/Desktop/assets_staging
139
171
  phls '*.mov'| phrename --shift_time 7200
140
172
  ```
141
173
 
142
174
  #### Then
143
- I get all _mov_ files in `~/Desktop/assets_staging` renamed with correct _YYYYmmdd-HHMMSS_ timestamp (+ 7200 second = + 2 hours than it was before).
144
175
 
145
- **********
176
+ I get all _mov_ files in `~/Desktop/assets_staging` renamed with correct _YYYYmmdd-HHMMSS_ timestamp \(+ 7200 second = + 2 hours than it was before\).
177
+
178
+ ---
146
179
 
147
180
  ## PHTOOLS concepts
181
+
148
182
  ### PHTOOLS Standard file name
149
- PHTOOLS standard file name looks like this: **`YYYYmmdd-HHMMSS_AAA ORIGINAL.EXT`**, where
150
183
 
151
- **YYYYmmdd-HHMMSS** - photo creation datestamp (year-month-day-hours-minutes-seconds). By default PHTOOLS use the value of EXIF tag groups `DateTimeOriginal` or `CreateDate` for this purpose _(for more details see phrename help: `phrename -h`)_.
184
+ PHTOOLS standard file name looks like this: `YYYYmmdd-HHMMSS_AAA ORIGINAL.EXT`, where
185
+
186
+ **YYYYmmdd-HHMMSS** - photo creation datestamp \(year-month-day-hours-minutes-seconds\). By default PHTOOLS use the value of EXIF tag groups `DateTimeOriginal` or `CreateDate` for this purpose _\(for more details see phrename help: _`phrename -h`_\)_.
152
187
 
153
188
  **AAA** - author nikname. 3 character long, only latin alphabet supported.
154
189
 
155
190
  **ORIGINAL.EXT** - original file name, created by digital camera.
156
191
 
157
- For example, the digital camera photo file `P1193691.JPG`, taken by AndrewBiz (aka ANB), after PHTOOLS processing will look like:
192
+ For example, the digital camera photo file `P1193691.JPG`, taken by AndrewBiz \(aka ANB\), after PHTOOLS processing will look like:
158
193
  `20160902-174939_ANB P1193691.JPG`
194
+
data/TODO.md CHANGED
@@ -2,6 +2,7 @@
2
2
  - [x] core - runner.rb: print class instance variables in debug mode
3
3
  - [x] get rid of nesty
4
4
  - [x] switch to fresh MiniExiftool gem
5
+ - [x] support of Apple HEIC files
5
6
 
6
7
  ### phls
7
8
  - [x] phls: use init method to initialize variables
@@ -0,0 +1,8 @@
1
+ # How to release a new gem version
2
+ 1. Develop and test the feature in a separate branch
3
+ 2. Merge branch in to master
4
+ 3. Bump a version (version.rb)
5
+ 4. Update TODO.md
6
+ 5. Update History.md
7
+ 6. Update README.md
8
+ 7. `rake release`
@@ -0,0 +1,8 @@
1
+ # Бортовой журнал проекта
2
+ ## 2018-01-22
3
+ Стоит попробовать альтернативные утилиты работы с тегами:
4
+ - [libexif/exif](https://github.com/libexif/exif)
5
+ - [exiv2](http://www.exiv2.org/getting-started.html)
6
+ - [jhead](http://www.sentex.net/~mwandel/jhead/)
7
+
8
+ Надо бы подумать и сделать выбираемыми движки для работы с тегами - либо exiftool либо альтернатива
@@ -10,7 +10,7 @@ require 'fileutils'
10
10
 
11
11
  module PhTools
12
12
  # media type constants
13
- FILE_TYPE_IMAGE_NORMAL = %w[jpg jpeg tif tiff png].freeze
13
+ FILE_TYPE_IMAGE_NORMAL = %w[jpg jpeg tif tiff png heic].freeze
14
14
  FILE_TYPE_IMAGE_RAW = %w[orf arw dng].freeze
15
15
  FILE_TYPE_IMAGE = FILE_TYPE_IMAGE_NORMAL + FILE_TYPE_IMAGE_RAW
16
16
  FILE_TYPE_VIDEO = %w[avi mp4 mpg mts dv mov mkv m2t m2ts 3gp].freeze
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PhTools
4
- VERSION = '0.15.1'
4
+ VERSION = '0.16.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Bizyaev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-04 00:00:00.000000000 Z
11
+ date: 2019-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -273,6 +273,8 @@ files:
273
273
  - exe/phmove
274
274
  - exe/phrename
275
275
  - exe/phtools
276
+ - extras/help-release.md
277
+ - extras/logbook.md
276
278
  - lib/phbackup.rb
277
279
  - lib/phevent.rb
278
280
  - lib/phfixdto.rb