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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32deda4c751be24b856a25e98b44e15d66838fb4
4
- data.tar.gz: 9d7c6693670cb4c1e7959ff8b11f936d043419d5
3
+ metadata.gz: dcc8f3016f64b8b1c8f99fc81bc0e25970b2a027
4
+ data.tar.gz: 7a5b1842fd84fe2983b9524eb4dd32194a6ead6e
5
5
  SHA512:
6
- metadata.gz: e61aee7251656d90966217242280f76699ded1c81f291b7aacf24ff70c55e5bc897ee551df112fb3f1a992dd0571200b0bd85984adf89aadb43e13b49c5236bf
7
- data.tar.gz: b6560a03645922b6a0cc2cef2c476773f9f7b1bc0ccd41b45ed3e29179066f037329f4075d9465e7c4826f81dd8cfdd60bb3f30f01571e2fb543582ce2cebdda
6
+ metadata.gz: 673cf64674cf0d5b89141594ec8407b9057df9b8cf1c344b6bf3c0a1040d212a04773c70c3a552277c9b1f4ec5553c681a6724a7f3a68d2d25fa406d6ac98a2e
7
+ data.tar.gz: 61fd9e68c424f24534814ce5e5cc48ccde3dc7333a2001b3b5cd14d1562371600ef581a6af1fd91cd5bd607b13d7962d320149deb7c00f5874050b029d45c122
data/.gitignore CHANGED
@@ -9,6 +9,8 @@
9
9
  /tmp/
10
10
  /spec/files/tmp.jpeg
11
11
  /spec/files/tmp.png
12
+ /spec/files/tmp_UC.JPEG
13
+ /spec/files/tmp_UC.PNG
12
14
 
13
15
  # rspec failure tracking
14
16
  .rspec_status
@@ -1,3 +1,6 @@
1
+ # 0.1.2
2
+ - Fix bug that fails to read and save file with upper case file extension.
3
+
1
4
  # 0.1.1
2
5
  - Refactor extension codes.
3
6
  - Fix to raise IOError when occured file reading / writing error.
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://www.rubydoc.info/gems/magro/0.1.1)
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.
@@ -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
@@ -3,5 +3,5 @@
3
3
  # Magro is an image processing library in Ruby.
4
4
  module Magro
5
5
  # The version of Magro you are using.
6
- VERSION = '0.1.1'
6
+ VERSION = '0.1.2'
7
7
  end
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.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-16 00:00:00.000000000 Z
11
+ date: 2019-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-narray