phtools 0.15.0 → 0.16.1

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
- SHA1:
3
- metadata.gz: 78670fe468c1b5d9bbf25c5a5d8460a408354f36
4
- data.tar.gz: 2566973828624a1aa604b02c0916d46cdec09b55
2
+ SHA256:
3
+ metadata.gz: '07819be1531f4b0bca4d3387341a0be066b73c7fa57bed97b9103b8f112b9acf'
4
+ data.tar.gz: 0b6b8306c431d955ea55f507ab8fc843044e4fc15599e21d9fa664a20a2546b0
5
5
  SHA512:
6
- metadata.gz: 9fac26d39ead526578a63fac032a39884dec6520b7220da590e476a86bc75013c4cd1490d90af61d22e0e36d49bd1b077bb4d5a40c7cca0db13b4c6cc6a66612
7
- data.tar.gz: 59fe892d791534da62fbc2e94d675eb38b4fc230ab40ce801601d21d887c9fe47ebad22a99ad5b20237e52d47dc2f9496189888328f698852bff6efec75cfab2
6
+ metadata.gz: 3967e0b17bc660c2dabe9b507b1d9a7d7a0a5da4b3d7a260847930b847519ea29c5778c16bec12717db8c79058462d85cc889b40691e41f4b7a83706f0ed8c1a
7
+ data.tar.gz: 99d05fdd12e4e5d2d3cc28c1c5021fbe621d7b2feb43fc83ccf94c0e1ec71f944ea14c1a59e5ab06ec511943828a07357c06fd2e7242790bd3a18d5049468e5d
data/.gitignore CHANGED
@@ -67,7 +67,6 @@ packer_cache/
67
67
  *.box
68
68
 
69
69
  # *** emacs
70
- *~
71
70
  \#*
72
71
  .\#*
73
72
 
@@ -78,7 +77,7 @@ packer_cache/
78
77
  *.un~
79
78
  Session.vim
80
79
  .netrwhist
81
- *~
80
+ # *~
82
81
 
83
82
  # *** ruby
84
83
  *.gem
@@ -116,4 +115,5 @@ rerun.txt
116
115
 
117
116
  ## gem development with bundle
118
117
  /Gemfile.lock
119
- /pkg/
118
+
119
+ /.idea/
data/.rspec CHANGED
File without changes
data/.rubocop.yml CHANGED
@@ -50,3 +50,6 @@ Style/UnneededInterpolation:
50
50
 
51
51
  Naming/AccessorMethodName:
52
52
  Enabled: false
53
+
54
+ Performance/RangeInclude:
55
+ Enabled: false
data/.rubocop_todo.yml CHANGED
File without changes
data/.travis.yml CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/Guardfile CHANGED
File without changes
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/LICENSE.txt CHANGED
File without changes
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/Rakefile CHANGED
File without changes
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`
data/extras/logbook.md ADDED
@@ -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 либо альтернатива
data/lib/phls.rb CHANGED
@@ -49,7 +49,7 @@ module PhTools
49
49
  def output_file(phfile)
50
50
  return unless @file_type.include?(phfile.type)
51
51
  if @range
52
- return unless (@range_start..@range_end).cover?(phfile.basename_clean.slice(-@ending_size, @ending_size))
52
+ return unless (@range_start..@range_end).include?(phfile.basename_clean.slice(-@ending_size, @ending_size))
53
53
  end
54
54
  @os.output(phfile)
55
55
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -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
File without changes
File without changes
File without changes
File without changes
data/lib/phtools/utils.rb CHANGED
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PhTools
4
- VERSION = '0.15.0'
4
+ VERSION = '0.16.1'
5
5
  end
data/phtools.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.required_ruby_version = '>= 2.0.0'
26
26
 
27
- spec.add_development_dependency 'bundler', '~> 1.12'
27
+ spec.add_development_dependency 'bundler'#, '~> 2.0'
28
28
  spec.add_development_dependency 'rake', '~> 10.0'
29
29
  spec.add_development_dependency 'rspec', '~> 3.0'
30
30
  spec.add_development_dependency 'rspec-its'
@@ -35,6 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'guard-rspec'
36
36
  spec.add_development_dependency 'guard-cucumber'
37
37
  spec.add_development_dependency 'pry'
38
+ spec.add_development_dependency 'bigdecimal', '1.3.5'
38
39
 
39
40
  if RbConfig::CONFIG['target_os'] =~ /darwin/i
40
41
  spec.add_development_dependency 'terminal-notifier-guard'
@@ -49,6 +50,7 @@ Gem::Specification.new do |spec|
49
50
  spec.add_runtime_dependency 'mini_exiftool', '~> 2.8'
50
51
  spec.add_runtime_dependency 'activesupport', '~> 3.2'
51
52
  spec.add_runtime_dependency 'i18n'
53
+ spec.add_runtime_dependency 'bigdecimal', '1.3.5'
52
54
 
53
55
  spec.post_install_message = %Q{***\n Thanks for installing phtools! Don't forget to get the ExifTool by Phil Harvey (http://www.sno.phy.queensu.ca/~phil/exiftool/) installed on your system.\n***}
54
56
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Bizyaev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-04 00:00:00.000000000 Z
11
+ date: 2022-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: bigdecimal
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '='
172
+ - !ruby/object:Gem::Version
173
+ version: 1.3.5
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '='
179
+ - !ruby/object:Gem::Version
180
+ version: 1.3.5
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: terminal-notifier-guard
169
183
  requirement: !ruby/object:Gem::Requirement
@@ -234,6 +248,20 @@ dependencies:
234
248
  - - ">="
235
249
  - !ruby/object:Gem::Version
236
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: bigdecimal
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - '='
256
+ - !ruby/object:Gem::Version
257
+ version: 1.3.5
258
+ type: :runtime
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - '='
263
+ - !ruby/object:Gem::Version
264
+ version: 1.3.5
237
265
  description: A bundle of small CLI tools for arranging, renaming, tagging of the photo
238
266
  and video files. Helps to keep your photo-video assets in order.
239
267
  email:
@@ -273,6 +301,8 @@ files:
273
301
  - exe/phmove
274
302
  - exe/phrename
275
303
  - exe/phtools
304
+ - extras/help-release.md
305
+ - extras/logbook.md
276
306
  - lib/phbackup.rb
277
307
  - lib/phevent.rb
278
308
  - lib/phfixdto.rb
@@ -343,9 +373,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
343
373
  version: '0'
344
374
  requirements:
345
375
  - ExifTool by Phil Harvey (http://www.sno.phy.queensu.ca/~phil/exiftool/)
346
- rubyforge_project:
347
- rubygems_version: 2.6.13
348
- signing_key:
376
+ rubygems_version: 3.1.4
377
+ signing_key:
349
378
  specification_version: 4
350
379
  summary: A set of usefull tools to manipulate photo-video files.
351
380
  test_files: []