magro 0.2.0 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.github/workflows/build.yml +23 -0
- data/.github/workflows/coverage.yml +29 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile +3 -1
- data/LICENSE.txt +1 -1
- data/README.md +18 -16
- data/ext/magro/{io.c → imgrw.c} +11 -1
- data/ext/magro/{io.h → imgrw.h} +0 -0
- data/ext/magro/magro.h +1 -1
- data/lib/magro.rb +1 -0
- data/lib/magro/filter.rb +118 -0
- data/lib/magro/io.rb +31 -4
- data/lib/magro/transform.rb +1 -1
- data/lib/magro/version.rb +1 -1
- data/magro.gemspec +12 -2
- metadata +23 -12
- data/.travis.yml +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f911e57e71f9fda41695c940712fd4e471d543dab28e924c9d15459cac02d62e
|
4
|
+
data.tar.gz: 37a3d0c6702219ec3cfee20fe9f319e2aff5945d1ed6d3ba28f842a9eee4a4c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff9033acf66ce81535d2c9aaa0e8843a35004cf9082b84b9aad1169c859074658e1b0bdb30b144d20f594264a7ad94c2be039f22462b1f8976edff9ffb08a01b
|
7
|
+
data.tar.gz: 938646fe6a9d838ec85f429a117f94ca44feb035d7e6b40ac8480549f81007b967a5ba6f79a204949848f5a4e9d17b25c360221744eb39b3d2f7beb6ec791d06
|
data/.coveralls.yml
ADDED
@@ -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', '3.0' ]
|
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 --no-document 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/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# 0.4.3
|
2
|
+
- Fix imread method to read image from URL.
|
3
|
+
- Fix some configulation files.
|
4
|
+
|
5
|
+
# 0.4.2
|
6
|
+
- Add GC guard to reading and writing image methods.
|
7
|
+
|
8
|
+
# 0.4.1
|
9
|
+
- Add GC guard to narray given to native extension method.
|
10
|
+
- Fix some configulation files.
|
11
|
+
|
12
|
+
# 0.4.0
|
13
|
+
- Rename extension file for reading and writing image file.
|
14
|
+
- Update documentations.
|
15
|
+
|
16
|
+
# 0.3.0
|
17
|
+
- Add [filter module](https://yoshoku.github.io/magro/doc/Magro/Filter.html) consists of image filtering methods.
|
18
|
+
- Change to use round instead of ceil in [quantization of resize method](https://github.com/yoshoku/magro/commit/1b3308ddfb98a650889483af3cd2045aaf6b8837) when given integer image.
|
19
|
+
|
1
20
|
# 0.2.0
|
2
21
|
- Add [transform module](https://yoshoku.github.io/magro/doc/Magro/Transform.html) and resize method.
|
3
22
|
- Fix some configulation files.
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,17 +1,21 @@
|
|
1
1
|
# Magro
|
2
2
|
|
3
|
-
[![Build Status](https://
|
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=main)](https://coveralls.io/github/yoshoku/magro?branch=main)
|
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/
|
6
|
-
[![Documentation](http://img.shields.io/badge/
|
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
|
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 libpng and libjpeg to provides functions
|
14
|
-
|
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.
|
15
19
|
|
16
20
|
macOS:
|
17
21
|
|
@@ -35,25 +39,23 @@ Or install it yourself as:
|
|
35
39
|
|
36
40
|
$ gem install magro
|
37
41
|
|
42
|
+
## Documentation
|
43
|
+
|
44
|
+
- [Magro API Documentation](https://yoshoku.github.io/magro/doc/)
|
45
|
+
|
38
46
|
## Usage
|
39
47
|
|
40
48
|
```ruby
|
41
49
|
> require 'magro'
|
42
50
|
=> true
|
43
|
-
> image = Magro::IO.imread('
|
51
|
+
> image = Magro::IO.imread('foo.png')
|
44
52
|
=> Numo::UInt8#shape=[512,512,3]
|
45
53
|
> grayscale = image.median(axis: 2)
|
46
54
|
=> Numo::UInt8#shape=[512,512]
|
47
|
-
> Magro::IO.imsave('
|
55
|
+
> Magro::IO.imsave('foo_gray.png', grayscale)
|
48
56
|
=> true
|
49
57
|
```
|
50
58
|
|
51
|
-
## Development
|
52
|
-
|
53
|
-
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.
|
54
|
-
|
55
|
-
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).
|
56
|
-
|
57
59
|
## Contributing
|
58
60
|
|
59
61
|
Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/magro.
|
@@ -61,4 +63,4 @@ This project is intended to be a safe, welcoming space for collaboration, and co
|
|
61
63
|
|
62
64
|
## Code of Conduct
|
63
65
|
|
64
|
-
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/
|
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).
|
data/ext/magro/{io.c → imgrw.c}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
#include "
|
1
|
+
#include "imgrw.h"
|
2
2
|
|
3
3
|
RUBY_EXTERN VALUE mMagro;
|
4
4
|
|
@@ -126,6 +126,8 @@ VALUE magro_io_read_png(VALUE self, VALUE filename_)
|
|
126
126
|
fclose(file_ptr);
|
127
127
|
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
128
128
|
|
129
|
+
RB_GC_GUARD(filename_);
|
130
|
+
|
129
131
|
return nary;
|
130
132
|
}
|
131
133
|
|
@@ -226,6 +228,9 @@ VALUE magro_io_save_png(VALUE self, VALUE filename_, VALUE image)
|
|
226
228
|
png_free(png_ptr, row_ptr_ptr);
|
227
229
|
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
228
230
|
|
231
|
+
RB_GC_GUARD(image);
|
232
|
+
RB_GC_GUARD(filename_);
|
233
|
+
|
229
234
|
return Qtrue;
|
230
235
|
}
|
231
236
|
|
@@ -298,6 +303,8 @@ VALUE magro_io_read_jpg(VALUE self, VALUE filename_)
|
|
298
303
|
jpeg_finish_decompress(&jpeg);
|
299
304
|
jpeg_destroy_decompress(&jpeg);
|
300
305
|
|
306
|
+
RB_GC_GUARD(filename_);
|
307
|
+
|
301
308
|
return nary;
|
302
309
|
}
|
303
310
|
|
@@ -398,6 +405,9 @@ VALUE magro_io_save_jpg(int argc, VALUE* argv, VALUE self)
|
|
398
405
|
|
399
406
|
fclose(file_ptr);
|
400
407
|
|
408
|
+
RB_GC_GUARD(image);
|
409
|
+
RB_GC_GUARD(filename_);
|
410
|
+
|
401
411
|
return Qtrue;
|
402
412
|
}
|
403
413
|
|
data/ext/magro/{io.h → imgrw.h}
RENAMED
File without changes
|
data/ext/magro/magro.h
CHANGED
data/lib/magro.rb
CHANGED
data/lib/magro/filter.rb
ADDED
@@ -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
|
data/lib/magro/io.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'open-uri'
|
4
|
+
require 'tempfile'
|
5
|
+
|
3
6
|
module Magro
|
4
7
|
# IO module provides functions for input and output of image file.
|
5
8
|
module IO
|
6
9
|
module_function
|
7
10
|
|
8
11
|
# Loads an image from file.
|
9
|
-
# @param filename [String]
|
12
|
+
# @param filename [String] File path or URL of image file to be loaded.
|
10
13
|
# Currently, the following file formats are support:
|
11
14
|
# Portbale Network Graphics (*.png) and JPEG files (*.jpeg, *.jpg, *jpe).
|
12
15
|
# @raise [ArgumentError] This error is raised when filename is not String.
|
@@ -15,8 +18,27 @@ module Magro
|
|
15
18
|
# @return [Numo::UInt8] (shape: [height, width, n_channels]) Loaded image.
|
16
19
|
def imread(filename)
|
17
20
|
raise ArgumentError, 'Expect class of filename to be String.' unless filename.is_a?(String)
|
18
|
-
|
19
|
-
|
21
|
+
|
22
|
+
unless url?(filename)
|
23
|
+
return case filename.downcase
|
24
|
+
when /\.(jpeg|jpg|jpe)$/
|
25
|
+
read_jpg(filename)
|
26
|
+
when /\.png$/
|
27
|
+
read_png(filename)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
uri = URI.parse(filename)
|
32
|
+
ext = File.extname(uri.path).downcase
|
33
|
+
raise IOError, 'Failed to detect file extension from given URL.' unless ext =~ /\.(jpeg|jpg|jpe|png)$/
|
34
|
+
|
35
|
+
uri.open do |file|
|
36
|
+
temp = Tempfile.new(['magro_', ext])
|
37
|
+
temp.binmode
|
38
|
+
temp.write(file.read)
|
39
|
+
temp.rewind
|
40
|
+
imread(temp.path)
|
41
|
+
end
|
20
42
|
end
|
21
43
|
|
22
44
|
# Saves an image to file.
|
@@ -46,6 +68,11 @@ module Magro
|
|
46
68
|
false
|
47
69
|
end
|
48
70
|
|
49
|
-
|
71
|
+
def url?(str)
|
72
|
+
uri = URI.parse(str)
|
73
|
+
uri.is_a?(URI::HTTP) || uri.is_a?(URI::HTTPS)
|
74
|
+
end
|
75
|
+
|
76
|
+
private_class_method :read_jpg, :read_png, :save_jpg, :save_png, :url?
|
50
77
|
end
|
51
78
|
end
|
data/lib/magro/transform.rb
CHANGED
@@ -58,7 +58,7 @@ module Magro
|
|
58
58
|
|
59
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
60
|
|
61
|
-
resized = resized.
|
61
|
+
resized = resized.round.clip(image.class::MIN, image.class::MAX) if integer_narray?(image)
|
62
62
|
resized = image.class.cast(resized) unless resized.is_a?(image.class)
|
63
63
|
resized.reshape(new_height, new_width)
|
64
64
|
end
|
data/lib/magro/version.rb
CHANGED
data/magro.gemspec
CHANGED
@@ -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
|
12
|
-
spec.description =
|
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
|
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.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshoku
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: numo-narray
|
@@ -24,7 +24,11 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.9.1
|
27
|
-
description:
|
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.
|
28
32
|
email:
|
29
33
|
- yoshoku@outlook.com
|
30
34
|
executables: []
|
@@ -32,9 +36,11 @@ extensions:
|
|
32
36
|
- ext/magro/extconf.rb
|
33
37
|
extra_rdoc_files: []
|
34
38
|
files:
|
39
|
+
- ".coveralls.yml"
|
40
|
+
- ".github/workflows/build.yml"
|
41
|
+
- ".github/workflows/coverage.yml"
|
35
42
|
- ".gitignore"
|
36
43
|
- ".rspec"
|
37
|
-
- ".travis.yml"
|
38
44
|
- CHANGELOG.md
|
39
45
|
- CODE_OF_CONDUCT.md
|
40
46
|
- Gemfile
|
@@ -44,11 +50,12 @@ files:
|
|
44
50
|
- bin/console
|
45
51
|
- bin/setup
|
46
52
|
- ext/magro/extconf.rb
|
47
|
-
- ext/magro/
|
48
|
-
- ext/magro/
|
53
|
+
- ext/magro/imgrw.c
|
54
|
+
- ext/magro/imgrw.h
|
49
55
|
- ext/magro/magro.c
|
50
56
|
- ext/magro/magro.h
|
51
57
|
- lib/magro.rb
|
58
|
+
- lib/magro/filter.rb
|
52
59
|
- lib/magro/io.rb
|
53
60
|
- lib/magro/transform.rb
|
54
61
|
- lib/magro/version.rb
|
@@ -56,8 +63,12 @@ files:
|
|
56
63
|
homepage: https://github.com/yoshoku/magro
|
57
64
|
licenses:
|
58
65
|
- BSD-3-Clause
|
59
|
-
metadata:
|
60
|
-
|
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:
|
61
72
|
rdoc_options: []
|
62
73
|
require_paths:
|
63
74
|
- lib
|
@@ -72,8 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
83
|
- !ruby/object:Gem::Version
|
73
84
|
version: '0'
|
74
85
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
76
|
-
signing_key:
|
86
|
+
rubygems_version: 3.2.7
|
87
|
+
signing_key:
|
77
88
|
specification_version: 4
|
78
|
-
summary: Magro is
|
89
|
+
summary: Magro is a minimal image processing library for Ruby.
|
79
90
|
test_files: []
|
data/.travis.yml
DELETED