magro 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/magro/io.rb +4 -4
- data/lib/magro/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcc8f3016f64b8b1c8f99fc81bc0e25970b2a027
|
4
|
+
data.tar.gz: 7a5b1842fd84fe2983b9524eb4dd32194a6ead6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 673cf64674cf0d5b89141594ec8407b9057df9b8cf1c344b6bf3c0a1040d212a04773c70c3a552277c9b1f4ec5553c681a6724a7f3a68d2d25fa406d6ac98a2e
|
7
|
+
data.tar.gz: 61fd9e68c424f24534814ce5e5cc48ccde3dc7333a2001b3b5cd14d1562371600ef581a6af1fd91cd5bd607b13d7962d320149deb7c00f5874050b029d45c122
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Build Status](https://travis-ci.org/yoshoku/magro.svg?branch=master)](https://travis-ci.org/yoshoku/magro)
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/magro.svg)](https://badge.fury.io/rb/magro)
|
5
5
|
[![BSD 3-Clause License](https://img.shields.io/badge/License-BSD%203--Clause-orange.svg)](https://github.com/yoshoku/numo-liblinear/blob/master/LICENSE.txt)
|
6
|
-
[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](https://
|
6
|
+
[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](https://yoshoku.github.io/magro/doc/)
|
7
7
|
|
8
8
|
Magro is an image processing library in Ruby.
|
9
9
|
Magro uses [Numo::NArray](https://github.com/ruby-numo/numo-narray) arrays as image objects.
|
data/lib/magro/io.rb
CHANGED
@@ -15,8 +15,8 @@ module Magro
|
|
15
15
|
# @return [Numo::UInt8] (shape: [height, width, n_channels]) Loaded image.
|
16
16
|
def imread(filename)
|
17
17
|
raise ArgumentError, 'Expect class of filename to be String.' unless filename.is_a?(String)
|
18
|
-
return read_jpg(filename) if filename =~ /\.(jpeg|jpg|jpe)$/
|
19
|
-
return read_png(filename) if filename =~ /\.png$/
|
18
|
+
return read_jpg(filename) if filename.downcase =~ /\.(jpeg|jpg|jpe)$/
|
19
|
+
return read_png(filename) if filename.downcase =~ /\.png$/
|
20
20
|
end
|
21
21
|
|
22
22
|
# Saves an image to file.
|
@@ -33,7 +33,7 @@ module Magro
|
|
33
33
|
raise ArgumentError, 'Expect class of filename to be String.' unless filename.is_a?(String)
|
34
34
|
raise ArgumentError, 'Expect class of image to be Numo::NArray.' unless image.is_a?(Numo::NArray)
|
35
35
|
|
36
|
-
if filename =~ /\.(jpeg|jpg|jpe)$/
|
36
|
+
if filename.downcase =~ /\.(jpeg|jpg|jpe)$/
|
37
37
|
unless quality.nil?
|
38
38
|
raise ArgumentError, 'Expect class of quality to be Numeric.' unless quality.is_a?(Numeric)
|
39
39
|
raise ArgumentError, 'Range of quality value between 0 to 100.' unless quality.between?(0, 100)
|
@@ -41,7 +41,7 @@ module Magro
|
|
41
41
|
return save_jpg(filename, image, quality)
|
42
42
|
end
|
43
43
|
|
44
|
-
return save_png(filename, image) if filename =~ /\.png$/
|
44
|
+
return save_png(filename, image) if filename.downcase =~ /\.png$/
|
45
45
|
|
46
46
|
false
|
47
47
|
end
|
data/lib/magro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshoku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08
|
11
|
+
date: 2019-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: numo-narray
|