image_quality_check 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5fbfb17831bb894d3890c10197aff1573ca1f6fbdcf0308f5ec1975cfd35cc6
4
- data.tar.gz: d5f5fdf1a2cb61f92566b26cc5954582a94116c056004a24323b93984307507d
3
+ metadata.gz: cf674903110348078cb6d877613cffda2c67a06b8aa3889bdfa227d7c42bd75a
4
+ data.tar.gz: e1217787f9881702bde46c201a84252ae3ef6fc7aae2d92366c80a7a47886488
5
5
  SHA512:
6
- metadata.gz: 594ca886f91f517ef6b71fda2cbf350cb4c41991434c3071aaad6f9e63d0d48a71fb1acc08a01835f2e927dd9774cb19655a9d63c63b5829b82796f22e6f6304
7
- data.tar.gz: 2b20142b04050a37d1b2655f6188ec69ac534f175acdf4234c4c07edc4760f3ec0b675f255afda053f080e836c852f93f69aa8c972441f80a58cabcff254bba4
6
+ metadata.gz: 2206394e34100393f30ee49df03d66f52ff4704029f203281942b7e5c7c5987e4326370992e0c1471fdf94b333eebd9e865705a1ca5ec23a29383d44eb661c94
7
+ data.tar.gz: c2e97deffc31c431d22f0c41948bfbb6806855f13c0335b66b27f283394b4e7ab0ec04242a922374e9ceee20c2a967e28f3e2848c9dc422cd4f3fa647440cf09
@@ -0,0 +1,32 @@
1
+ name: Verify
2
+ on: [push]
3
+
4
+ jobs:
5
+ tests:
6
+ name: Tests
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ # ruby: [ '2.5', '2.6', '2.7' ]
11
+ ruby: [ '2.6' ]
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: Dovyski/setup-opencv-action@v1
15
+ - uses: actions/setup-python@v2
16
+ with:
17
+ python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
18
+ architecture: 'x64' # o
19
+ - uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ - name: Install gems
23
+ run: |
24
+ bundle config path vendor/bundle
25
+ bundle install --jobs 4 --retry 3
26
+ - name: Install python dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install opencv-python PyWavelets
30
+ - name: Run tests
31
+ run: bundle exec rspec
32
+
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # ImageQuality
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/image_quality_check.svg)](https://badge.fury.io/rb/image_quality_check)
4
+
3
5
  Thin gem wrapper that uses ``imagemagick`` and ``python-opencv`` to help determine image quality.
4
6
 
5
7
 
@@ -19,7 +21,7 @@ apt-get install python3-pywt python3-opencv
19
21
  Add this line to your application's Gemfile:
20
22
 
21
23
  ```ruby
22
- gem 'image_quality'
24
+ gem 'image_quality_check'
23
25
  ```
24
26
 
25
27
  ## Usage
@@ -17,7 +17,8 @@ module ImageQualityCheck
17
17
  # image magick gif delay bug invalid json
18
18
  # https://github.com/ImageMagick/ImageMagick/issues/1624
19
19
  out.gsub!(/("delay": "[^"]+")\n/m, "\\1,\n")
20
- json = JSON.parse(out)['image']
20
+ raw_json = JSON.parse(out)
21
+ json = raw_json.is_a?(Array) ? raw_json.first['image'] : raw_json['image']
21
22
  background_is_transparent =
22
23
  json.dig('channelDepth', 'alpha') &&
23
24
  json['channelStatistics']['alpha']['min'] != json['channelStatistics']['alpha']['max']
@@ -1,3 +1,3 @@
1
1
  module ImageQualityCheck
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_quality_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Wienert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-09 00:00:00.000000000 Z
11
+ date: 2020-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -32,6 +32,7 @@ executables:
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
+ - ".github/workflows/verify.yml"
35
36
  - ".gitignore"
36
37
  - ".rspec"
37
38
  - Gemfile