magro 0.1.1 → 0.4.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: 32deda4c751be24b856a25e98b44e15d66838fb4
4
- data.tar.gz: 9d7c6693670cb4c1e7959ff8b11f936d043419d5
2
+ SHA256:
3
+ metadata.gz: c0f74c38e2926ef457007ee28be4eb37fa563aa22cde82ad44a800b89c4548d7
4
+ data.tar.gz: 6e5d4404ffaea48bdae59dbdeb7d11bf3b8a7ba7883d3e36d9b2106931e80cad
5
5
  SHA512:
6
- metadata.gz: e61aee7251656d90966217242280f76699ded1c81f291b7aacf24ff70c55e5bc897ee551df112fb3f1a992dd0571200b0bd85984adf89aadb43e13b49c5236bf
7
- data.tar.gz: b6560a03645922b6a0cc2cef2c476773f9f7b1bc0ccd41b45ed3e29179066f037329f4075d9465e7c4826f81dd8cfdd60bb3f30f01571e2fb543582ce2cebdda
6
+ metadata.gz: f2ad54fd188784f89e593d542fc11faeebed3db60498ff74d36fc3a174ea36957aee7e3b9fe1097578ddf7c4e684f0b12c9fa0f9128acfe3e55dff2803b10ddb
7
+ data.tar.gz: ede89931ba5d684ab0961caa7234b30f579830769704a0fe9c0ab4c49e070cc977efca59dab71400a94518e494634e723ae186bcb623aa8c250a2ab32b44dd72
@@ -0,0 +1 @@
1
+ service_name: github-ci
@@ -0,0 +1,23 @@
1
+ name: build
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-20.04
8
+ strategy:
9
+ matrix:
10
+ ruby: [ '2.5', '2.6', '2.7' ]
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - name: Install libpng and libjpeg
14
+ run: sudo apt-get install -y libpng-dev libjpeg-dev
15
+ - name: Set up Ruby ${{ matrix.ruby }}
16
+ uses: actions/setup-ruby@v1
17
+ with:
18
+ ruby-version: ${{ matrix.ruby }}
19
+ - name: Build and test with Rake
20
+ run: |
21
+ gem install bundler
22
+ bundle install --jobs 4 --retry 3
23
+ bundle exec rake
@@ -0,0 +1,29 @@
1
+ name: coverage
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ coverage:
11
+ runs-on: ubuntu-20.04
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Install libpng and libjpeg
15
+ run: sudo apt-get install -y libpng-dev libjpeg-dev
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby 2.7
18
+ uses: actions/setup-ruby@v1
19
+ with:
20
+ ruby-version: '2.7'
21
+ - name: Build and test with Rake
22
+ run: |
23
+ gem install bundler
24
+ bundle install
25
+ bundle exec rake
26
+ - name: Coveralls GitHub Action
27
+ uses: coverallsapp/github-action@v1.1.2
28
+ with:
29
+ github-token: ${{ secrets.GITHUB_TOKEN }}
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,22 @@
1
+ # 0.4.1
2
+ - Add GC guard to narray given to native extension method.
3
+ - Fix some configulation files.
4
+
5
+ # 0.4.0
6
+ - Rename extension file for reading and writing image file.
7
+ - Update documentations.
8
+
9
+ # 0.3.0
10
+ - Add [filter module](https://yoshoku.github.io/magro/doc/Magro/Filter.html) consists of image filtering methods.
11
+ - Change to use round instead of ceil in [quantization of resize method](https://github.com/yoshoku/magro/commit/1b3308ddfb98a650889483af3cd2045aaf6b8837) when given integer image.
12
+
13
+ # 0.2.0
14
+ - Add [transform module](https://yoshoku.github.io/magro/doc/Magro/Transform.html) and resize method.
15
+ - Fix some configulation files.
16
+
17
+ # 0.1.2
18
+ - Fix bug that fails to read and save file with upper case file extension.
19
+
1
20
  # 0.1.1
2
21
  - Refactor extension codes.
3
22
  - Fix to raise IOError when occured file reading / writing error.
data/Gemfile CHANGED
@@ -1,4 +1,11 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in magro.gemspec
4
4
  gemspec
5
+
6
+ gem 'bundler', '~> 2.0'
7
+ gem 'rake', '~> 12.0'
8
+ gem 'rake-compiler', '~> 1.0'
9
+ gem 'rspec', '~> 3.0'
10
+ gem 'simplecov', '~> 0.19'
11
+ gem 'simplecov-lcov', '~> 0.8'
@@ -1,4 +1,4 @@
1
- Copyright (c) 2019 Atsushi Tatsuma
1
+ Copyright (c) 2019-2021 Atsushi Tatsuma
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -1,22 +1,27 @@
1
1
  # Magro
2
2
 
3
- [![Build Status](https://travis-ci.org/yoshoku/magro.svg?branch=master)](https://travis-ci.org/yoshoku/magro)
3
+ [![Build Status](https://github.com/yoshoku/magro/workflows/build/badge.svg)](https://github.com/yoshoku/magro/actions?query=workflow%3Abuild)
4
+ [![Coverage Status](https://coveralls.io/repos/github/yoshoku/magro/badge.svg?branch=master)](https://coveralls.io/github/yoshoku/magro?branch=master)
4
5
  [![Gem Version](https://badge.fury.io/rb/magro.svg)](https://badge.fury.io/rb/magro)
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
+ [![BSD 3-Clause License](https://img.shields.io/badge/License-BSD%203--Clause-orange.svg)](https://github.com/yoshoku/numo-liblinear/blob/main/LICENSE.txt)
7
+ [![Documentation](http://img.shields.io/badge/api-reference-blue.svg)](https://yoshoku.github.io/magro/doc/)
7
8
 
8
- Magro is an image processing library in Ruby.
9
- Magro uses [Numo::NArray](https://github.com/ruby-numo/numo-narray) arrays as image objects.
9
+ Magro is a minimal image processing library in Ruby.
10
+ Magro uses [Numo::NArray](https://github.com/ruby-numo/numo-narray) arrays as image objects and
11
+ provides basic image processing functions.
12
+ Current supporting features are reading and writing JPEG and PNG images,
13
+ image resizing with bilinear interpolation method, and image filtering.
10
14
 
11
15
  ## Installation
12
16
 
13
- Magro dependents some external libraries to provides functions loading image file.
17
+ Magro dependents libpng and libjpeg to provides functions reading and writing image file.
18
+ Moreover, it is recommended that using libpng version 1.6 or later.
14
19
 
15
20
  macOS:
16
21
 
17
22
  $ brew install libpng libjpeg
18
23
 
19
- Ubuntu:
24
+ Ubuntu (bionic):
20
25
 
21
26
  $ sudo apt-get install libpng-dev libjpeg-dev
22
27
 
@@ -34,25 +39,23 @@ Or install it yourself as:
34
39
 
35
40
  $ gem install magro
36
41
 
42
+ ## Documentation
43
+
44
+ - [Magro API Documentation](https://yoshoku.github.io/magro/doc/)
45
+
37
46
  ## Usage
38
47
 
39
48
  ```ruby
40
49
  > require 'magro'
41
50
  => true
42
- > image = Magro::IO.imread('lena.png')
51
+ > image = Magro::IO.imread('foo.png')
43
52
  => Numo::UInt8#shape=[512,512,3]
44
53
  > grayscale = image.median(axis: 2)
45
54
  => Numo::UInt8#shape=[512,512]
46
- > Magro::IO.imsave('lena_gray.png', grayscale)
55
+ > Magro::IO.imsave('foo_gray.png', grayscale)
47
56
  => true
48
57
  ```
49
58
 
50
- ## Development
51
-
52
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
53
-
54
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
55
-
56
59
  ## Contributing
57
60
 
58
61
  Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/magro.
@@ -60,4 +63,4 @@ This project is intended to be a safe, welcoming space for collaboration, and co
60
63
 
61
64
  ## Code of Conduct
62
65
 
63
- Everyone interacting in the Magro project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yoshoku/magro/blob/master/CODE_OF_CONDUCT.md).
66
+ Everyone interacting in the Magro project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yoshoku/magro/blob/main/CODE_OF_CONDUCT.md).
@@ -1,4 +1,4 @@
1
- #include "io.h"
1
+ #include "imgrw.h"
2
2
 
3
3
  RUBY_EXTERN VALUE mMagro;
4
4
 
@@ -226,6 +226,8 @@ VALUE magro_io_save_png(VALUE self, VALUE filename_, VALUE image)
226
226
  png_free(png_ptr, row_ptr_ptr);
227
227
  png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
228
228
 
229
+ RB_GC_GUARD(image);
230
+
229
231
  return Qtrue;
230
232
  }
231
233
 
@@ -398,6 +400,8 @@ VALUE magro_io_save_jpg(int argc, VALUE* argv, VALUE self)
398
400
 
399
401
  fclose(file_ptr);
400
402
 
403
+ RB_GC_GUARD(image);
404
+
401
405
  return Qtrue;
402
406
  }
403
407
 
File without changes
@@ -3,6 +3,6 @@
3
3
 
4
4
  #include <ruby.h>
5
5
 
6
- #include "io.h"
6
+ #include "imgrw.h"
7
7
 
8
8
  #endif /* MAGRO_H */
@@ -5,4 +5,6 @@ require 'numo/narray'
5
5
  require 'magro/version'
6
6
  require 'magro/magro'
7
7
 
8
+ require 'magro/filter'
8
9
  require 'magro/io'
10
+ require 'magro/transform'
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Magro
4
+ # Filter module provides functions for image filtering.
5
+ module Filter
6
+ module_function
7
+
8
+ # Applies box filter to image.
9
+ # This method performs zero padding as a preprocessing.
10
+ #
11
+ # @example
12
+ # image = Magro::IO.imread('foo.png')
13
+ # kernel = Numo::DFloat[
14
+ # [1, 1, 1],
15
+ # [1, 1, 1],
16
+ # [1, 1, 1]
17
+ # ]
18
+ # blured_image = Magro::Filter.filter2d(image, kernel)
19
+ # Magro::IO.imsave('bar.png', blured_image)
20
+ #
21
+ # @param image [Numo::UInt8] (shape: [height, width, n_channels]) Input image to be filtered.
22
+ # @param kernel [Numo::DFloat] (shape: [kernel_height, kernel_width]) Box filter.
23
+ # @param scale [Float/Nil] Scale parameter for box filter. If nil is given, the box filter is normalized with sum of filter values.
24
+ # @param offset [Integer] Offset value of filtered image.
25
+ # @raise [ArgumentError] This error is raised when class of input image is not Numo::NArray.
26
+ # @return [Numo::UInt8] (shape: [height, width, n_channels]) Filtered image.
27
+ def filter2d(image, kernel, scale: nil, offset: 0)
28
+ raise ArgumentError, 'Expect class of image to be Numo::NArray.' unless image.is_a?(Numo::NArray)
29
+ filter_h, filter_w = kernel.shape
30
+ padded = zero_padding(image, filter_h, filter_w)
31
+ n_channels = image.shape[2]
32
+ if n_channels.nil?
33
+ filter1ch(padded, kernel, scale, offset)
34
+ else
35
+ image.class.zeros(*image.shape).tap do |filtered|
36
+ n_channels.times do |c|
37
+ filtered[true, true, c] = filter1ch(padded[true, true, c], kernel, scale, offset)
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ # Convolve two 2-dimensional arrays.
44
+ #
45
+ # @param arr1 [Numo::NArray] (shape: [row1, col1]) First input array.
46
+ # @param arr2 [Numo::NArray] (shape: [row2, col2]) Second input array.
47
+ # @raise [ArgumentError] This error is raised when class of input array is not Numo::NArray.
48
+ # @return [Numo::NArray] (shape: [row1 - row2 + 1, col1 - col2 + 1]) Convolution of arr1 with arr2.
49
+ def convolve2d(arr1, arr2)
50
+ raise ArgumentError, 'Expect class of first input array to be Numo::NArray.' unless arr1.is_a?(Numo::NArray)
51
+ raise ArgumentError, 'Expect class of second input array to be Numo::NArray.' unless arr2.is_a?(Numo::NArray)
52
+ raise ArgumentError, 'Expect first input array to be 2-dimensional array.' unless arr1.ndim == 2
53
+ raise ArgumentError, 'Expect second input array to be 2-dimensional array.' unless arr2.ndim == 2
54
+ row1, col1 = arr1.shape
55
+ row2, col2 = arr2.shape
56
+ # FIXME: lib/numo/narray/extra.rb:1098: warning: Using the last argument as keyword parameters is deprecated
57
+ # convolved = im2col(arr1, row2, col2).dot(arr2.flatten)
58
+ convolved = arr2.flatten.dot(im2col(arr1, row2, col2).transpose)
59
+ convolved.reshape(row1 - row2 + 1, col1 - col2 + 1)
60
+ end
61
+
62
+ # private
63
+
64
+ def zero_padding(image, filter_h, filter_w)
65
+ image_h, image_w, n_channels = image.shape
66
+ pad_h = filter_h / 2
67
+ pad_w = filter_w / 2
68
+ out_h = image_h + pad_h * 2
69
+ out_w = image_w + pad_w * 2
70
+ if n_channels.nil?
71
+ image.class.zeros(out_h, out_w).tap do |padded|
72
+ padded[pad_h...(pad_h + image_h), pad_w...(pad_w + image_w)] = image
73
+ end
74
+ else
75
+ image.class.zeros(out_h, out_w, n_channels).tap do |padded|
76
+ n_channels.times do |c|
77
+ padded[pad_h...(pad_h + image_h), pad_w...(pad_w + image_w), c] = image[true, true, c]
78
+ end
79
+ end
80
+ end
81
+ end
82
+
83
+ def filter1ch(image, kernel, scale, offset)
84
+ scale ||= kernel.sum
85
+ kernel *= scale.zero? ? 1.0 : 1.fdiv(scale)
86
+ filtered = convolve2d(image, kernel)
87
+ filtered = (filtered + offset).round.clip(image.class::MIN, image.class::MAX) if integer_narray?(image)
88
+ filtered = image.class.cast(filtered) unless filtered.is_a?(image.class)
89
+ filtered
90
+ end
91
+
92
+ def im2col(image, filter_h, filter_w)
93
+ height, width = image.shape
94
+ rows = height - filter_h + 1
95
+ cols = width - filter_w + 1
96
+ mat = image.class.zeros(filter_h, filter_w, rows, cols)
97
+ filter_h.times do |y|
98
+ y_end = y + rows
99
+ filter_w.times do |x|
100
+ x_end = x + cols
101
+ mat[y, x, true, true] = image[y...y_end, x...x_end]
102
+ end
103
+ end
104
+ mat.transpose(2, 3, 0, 1).reshape(rows * cols, filter_h * filter_w)
105
+ end
106
+
107
+ INTEGER_NARRAY = %w[Numo::Int8 Numo::Int16 Numo::Int32 Numo::Int64
108
+ Numo::UInt8 Numo::UInt16 Numo::UInt32 Numo::UInt64].freeze
109
+
110
+ private_constant :INTEGER_NARRAY
111
+
112
+ def integer_narray?(image)
113
+ INTEGER_NARRAY.include?(image.class.to_s)
114
+ end
115
+
116
+ private_class_method :zero_padding, :filter1ch, :im2col, :integer_narray?
117
+ end
118
+ end
@@ -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
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Magro
4
+ # Transform module provide functions of image transfom.
5
+ module Transform
6
+ module_function
7
+
8
+ # Resizes an image with bilinear interpolation method.
9
+ #
10
+ # @example
11
+ # require 'numo/narray'
12
+ # require 'magro'
13
+ #
14
+ # image = Numo::UInt8.new(16, 16).seq
15
+ # resized = Magro::Transform.resize(image, height: 64, width: 64)
16
+ #
17
+ # @param image [Numo::UInt8] (shape: [height, width, n_channels] or [height, width]) Image data to be saved.
18
+ # @param height [Integer] Requested height in pixels.
19
+ # @param width [Integer] Requested width in pixels.
20
+ # @return [Numo::UInt8] (shape: [height, width, n_channels] or [height, width]) Resized image data.
21
+ def resize(image, height:, width:)
22
+ n_channels = image.shape[2]
23
+
24
+ if n_channels.nil?
25
+ bilinear_resize(image, height, width)
26
+ else
27
+ resized = image.class.zeros(height, width, n_channels)
28
+ n_channels.times { |c| resized[true, true, c] = bilinear_resize(image[true, true, c], height, width) }
29
+ resized
30
+ end
31
+ end
32
+
33
+ # private
34
+
35
+ def bilinear_resize(image, new_height, new_width)
36
+ height, width = image.shape
37
+
38
+ y_ratio = height.fdiv(new_height)
39
+ x_ratio = width.fdiv(new_width)
40
+
41
+ y, x = Numo::Int32.new(new_height * new_width).seq.divmod(new_width)
42
+
43
+ y_p = Numo::Int32.cast((y_ratio * (y + 0.5) - 0.5).floor).clip(0, height - 1)
44
+ x_p = Numo::Int32.cast((x_ratio * (x + 0.5) - 0.5).floor).clip(0, width - 1)
45
+ y_n = Numo::Int32.cast((y_ratio * (y + 0.5) - 0.5).ceil).clip(0, height - 1)
46
+ x_n = Numo::Int32.cast((x_ratio * (x + 0.5) - 0.5).ceil).clip(0, width - 1)
47
+
48
+ flt = image.flatten
49
+ a = flt[y_p * width + x_p]
50
+ b = flt[y_p * width + x_n]
51
+ c = flt[y_n * width + x_p]
52
+ d = flt[y_n * width + x_n]
53
+
54
+ y_d = y_ratio * (y + 0.5) - 0.5
55
+ x_d = x_ratio * (x + 0.5) - 0.5
56
+ y_d = y_d.class.maximum(0, y_d - y_d.floor)
57
+ x_d = x_d.class.maximum(0, x_d - x_d.floor)
58
+
59
+ resized = a * (1 - x_d) * (1 - y_d) + b * x_d * (1 - y_d) + c * (1 - x_d) * y_d + d * x_d * y_d
60
+
61
+ resized = resized.round.clip(image.class::MIN, image.class::MAX) if integer_narray?(image)
62
+ resized = image.class.cast(resized) unless resized.is_a?(image.class)
63
+ resized.reshape(new_height, new_width)
64
+ end
65
+
66
+ INTEGER_NARRAY = %w[Numo::Int8 Numo::Int16 Numo::Int32 Numo::Int64
67
+ Numo::UInt8 Numo::UInt16 Numo::UInt32 Numo::UInt64].freeze
68
+
69
+ private_constant :INTEGER_NARRAY
70
+
71
+ def integer_narray?(image)
72
+ INTEGER_NARRAY.include?(image.class.to_s)
73
+ end
74
+
75
+ private_class_method :bilinear_resize, :integer_narray?
76
+ end
77
+ 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.4.1'
7
7
  end
@@ -8,12 +8,22 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ['yoshoku']
9
9
  spec.email = ['yoshoku@outlook.com']
10
10
 
11
- spec.summary = 'Magro is an image processing library for Ruby.'
12
- spec.description = 'Magro is an image processing library for Ruby.'
11
+ spec.summary = 'Magro is a minimal image processing library for Ruby.'
12
+ spec.description = <<~MSG
13
+ Magro is a minimal image processing library for Ruby.
14
+ Magro uses Numo::NArray arrays as image objects and provides basic image processing functions.
15
+ Current supporting features are reading and writing JPEG and PNG images,
16
+ image resizing with bilinear interpolation method, and image filtering.
17
+ MSG
13
18
 
14
19
  spec.homepage = 'https://github.com/yoshoku/magro'
15
20
  spec.license = 'BSD-3-Clause'
16
21
 
22
+ spec.metadata['homepage_uri'] = spec.homepage
23
+ spec.metadata['source_code_uri'] = 'https://github.com/yoshoku/magro'
24
+ spec.metadata['changelog_uri'] = 'https://github.com/yoshoku/magro/blob/main/CHANGELOG.md'
25
+ spec.metadata['documentation_uri'] = 'https://yoshoku.github.io/magro/doc/'
26
+
17
27
  # Specify which files should be added to the gem when it is released.
18
28
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
29
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
@@ -26,9 +36,4 @@ Gem::Specification.new do |spec|
26
36
  spec.extensions = ['ext/magro/extconf.rb']
27
37
 
28
38
  spec.add_runtime_dependency 'numo-narray', '~> 0.9.1'
29
-
30
- spec.add_development_dependency 'bundler', '~> 2.0'
31
- spec.add_development_dependency 'rake', '~> 10.0'
32
- spec.add_development_dependency 'rake-compiler', '~> 1.0'
33
- spec.add_development_dependency 'rspec', '~> 3.0'
34
39
  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.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-16 00:00:00.000000000 Z
11
+ date: 2021-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: numo-narray
@@ -24,63 +24,11 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.1
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '2.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '10.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '10.0'
55
- - !ruby/object:Gem::Dependency
56
- name: rake-compiler
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.0'
83
- description: Magro is an image processing library for Ruby.
27
+ description: |
28
+ Magro is a minimal image processing library for Ruby.
29
+ Magro uses Numo::NArray arrays as image objects and provides basic image processing functions.
30
+ Current supporting features are reading and writing JPEG and PNG images,
31
+ image resizing with bilinear interpolation method, and image filtering.
84
32
  email:
85
33
  - yoshoku@outlook.com
86
34
  executables: []
@@ -88,9 +36,11 @@ extensions:
88
36
  - ext/magro/extconf.rb
89
37
  extra_rdoc_files: []
90
38
  files:
39
+ - ".coveralls.yml"
40
+ - ".github/workflows/build.yml"
41
+ - ".github/workflows/coverage.yml"
91
42
  - ".gitignore"
92
43
  - ".rspec"
93
- - ".travis.yml"
94
44
  - CHANGELOG.md
95
45
  - CODE_OF_CONDUCT.md
96
46
  - Gemfile
@@ -100,19 +50,25 @@ files:
100
50
  - bin/console
101
51
  - bin/setup
102
52
  - ext/magro/extconf.rb
103
- - ext/magro/io.c
104
- - ext/magro/io.h
53
+ - ext/magro/imgrw.c
54
+ - ext/magro/imgrw.h
105
55
  - ext/magro/magro.c
106
56
  - ext/magro/magro.h
107
57
  - lib/magro.rb
58
+ - lib/magro/filter.rb
108
59
  - lib/magro/io.rb
60
+ - lib/magro/transform.rb
109
61
  - lib/magro/version.rb
110
62
  - magro.gemspec
111
63
  homepage: https://github.com/yoshoku/magro
112
64
  licenses:
113
65
  - BSD-3-Clause
114
- metadata: {}
115
- post_install_message:
66
+ metadata:
67
+ homepage_uri: https://github.com/yoshoku/magro
68
+ source_code_uri: https://github.com/yoshoku/magro
69
+ changelog_uri: https://github.com/yoshoku/magro/blob/main/CHANGELOG.md
70
+ documentation_uri: https://yoshoku.github.io/magro/doc/
71
+ post_install_message:
116
72
  rdoc_options: []
117
73
  require_paths:
118
74
  - lib
@@ -127,9 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
83
  - !ruby/object:Gem::Version
128
84
  version: '0'
129
85
  requirements: []
130
- rubyforge_project:
131
- rubygems_version: 2.6.14.4
132
- signing_key:
86
+ rubygems_version: 3.1.4
87
+ signing_key:
133
88
  specification_version: 4
134
- summary: Magro is an image processing library for Ruby.
89
+ summary: Magro is a minimal image processing library for Ruby.
135
90
  test_files: []
@@ -1,14 +0,0 @@
1
- ---
2
- sudo: true
3
- os: linux
4
- dist: bionic
5
- language: ruby
6
- cache: bundler
7
- rvm:
8
- - '2.4'
9
- - '2.5'
10
- - '2.6'
11
-
12
- before_install:
13
- - sudo apt-get install -y libpng-dev libjpeg-dev
14
- - gem install bundler -v 2.0.2