webp-ffi 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +45 -0
- data/.gitignore +1 -0
- data/.tool-versions +1 -0
- data/README.md +1 -2
- data/ext/webp_ffi/Rakefile +0 -5
- data/ext/webp_ffi/tiffdec.c +4 -4
- data/lib/webp/version.rb +1 -1
- data/spec/webp_ffi_spec.rb +1 -1
- metadata +7 -7
- data/.ruby-version +0 -1
- data/.travis.yml +0 -38
- /data/spec/{travis_build.sh → build.sh} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecda2fb2748d3fb12bed751cfca88e986390e60788a10f18d8802d14b563d255
|
4
|
+
data.tar.gz: 66acf9c6fa79655106507da29b63d2362ca273e49738b56cbc6cadf905fc075d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 518b57f8c6d8c03f14ffeb2088f49db71152309fe7d2519f88c26a78b0ab34fedcb35d0ad95ce7f0b5c5f530b3b2b566385b36b0d30ba663ca56fe1899b55b1e
|
7
|
+
data.tar.gz: f716a1436fdef874ba6459f25549777e041e3013f8aa9f62aa4679fbdc27639dcaec2d9e614ab22de04d517b143370c2d04265719a90ee01154c770ba4fefecf
|
@@ -0,0 +1,45 @@
|
|
1
|
+
name: Build
|
2
|
+
on: push
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
test:
|
6
|
+
name: "Build"
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: ['2.7', '3.0', '3.1', '3.2']
|
11
|
+
libwebp: ['0.4.4', '1.0.2', '1.3.1']
|
12
|
+
steps:
|
13
|
+
- name: Checkout code
|
14
|
+
uses: actions/checkout@v3
|
15
|
+
|
16
|
+
- name: Setup Ruby ${{ matrix.ruby }}
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
bundler-cache: true
|
20
|
+
ruby-version: ${{ matrix.ruby }}
|
21
|
+
|
22
|
+
- name: Prepare libwebp ${{ matrix.libwebp }}
|
23
|
+
run: |
|
24
|
+
./spec/build.sh
|
25
|
+
env:
|
26
|
+
LIBWEBP_VERSION: ${{ matrix.libwebp }}
|
27
|
+
|
28
|
+
- name: Set envs
|
29
|
+
run: |
|
30
|
+
echo "LD_FLAGS=-L$HOME/opt/lib" >> $GITHUB_ENV
|
31
|
+
echo "LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/lib" >> $GITHUB_ENV
|
32
|
+
echo "CPATH=$CPATH:$HOME/opt/include" >> $GITHUB_ENV
|
33
|
+
|
34
|
+
- name: Build package
|
35
|
+
run: |
|
36
|
+
bundle exec rake compile
|
37
|
+
|
38
|
+
- name: Test package
|
39
|
+
run: |
|
40
|
+
bundle exec rake spec
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
data/.gitignore
CHANGED
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.2.2
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Webp-ffi
|
2
2
|
|
3
|
-
[![Build
|
4
|
-
[![Code Climate](https://codeclimate.com/github/le0pard/webp-ffi/badges/gpa.svg)](https://codeclimate.com/github/le0pard/webp-ffi)
|
3
|
+
[![Build](https://github.com/le0pard/webp-ffi/actions/workflows/build.yml/badge.svg)](https://github.com/le0pard/webp-ffi/actions/workflows/build.yml)
|
5
4
|
|
6
5
|
Ruby wrapper for libwebp. What is WebP?
|
7
6
|
|
data/ext/webp_ffi/Rakefile
CHANGED
@@ -14,11 +14,6 @@ FFI::Compiler::CompileTask.new('webp_ffi') do |c|
|
|
14
14
|
c.have_library?('png')
|
15
15
|
c.have_library?('jpeg')
|
16
16
|
c.have_library?('tiff')
|
17
|
-
# compiler flags
|
18
|
-
if c.platform.mac?
|
19
|
-
c.cflags << "-arch x86_64"
|
20
|
-
c.ldflags << "-arch x86_64"
|
21
|
-
end
|
22
17
|
c.ldflags << ENV['LD_FLAGS'] if ENV['LD_FLAGS']
|
23
18
|
c.cflags << ENV['C_FLAGS'] if ENV['C_FLAGS']
|
24
19
|
end
|
data/ext/webp_ffi/tiffdec.c
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
int UtilReadTIFF(const char* const filename,
|
6
6
|
WebPPicture* const pic, int keep_alpha) {
|
7
7
|
TIFF* const tif = TIFFOpen(filename, "r");
|
8
|
-
|
9
|
-
|
8
|
+
uint32_t width, height;
|
9
|
+
uint32_t* raster;
|
10
10
|
int ok = 0;
|
11
11
|
int dircount = 1;
|
12
12
|
|
@@ -25,7 +25,7 @@ int UtilReadTIFF(const char* const filename,
|
|
25
25
|
|
26
26
|
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width);
|
27
27
|
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height);
|
28
|
-
raster = (
|
28
|
+
raster = (uint32_t*)_TIFFmalloc(width * height * sizeof(*raster));
|
29
29
|
if (raster != NULL) {
|
30
30
|
if (TIFFReadRGBAImageOriented(tif, width, height, raster,
|
31
31
|
ORIENTATION_TOPLEFT, 1)) {
|
@@ -194,4 +194,4 @@ int UtilWriteBMP(FILE* fout, const WebPDecBuffer* const buffer) {
|
|
194
194
|
}
|
195
195
|
return 1;
|
196
196
|
}
|
197
|
-
#undef BMP_HEADER_SIZE
|
197
|
+
#undef BMP_HEADER_SIZE
|
data/lib/webp/version.rb
CHANGED
data/spec/webp_ffi_spec.rb
CHANGED
@@ -32,7 +32,7 @@ describe WebP do
|
|
32
32
|
|
33
33
|
before :all do
|
34
34
|
@out_dir = File.expand_path(File.join(File.dirname(__FILE__), "../tmp/"))
|
35
|
-
Dir.mkdir(@out_dir) unless File.
|
35
|
+
Dir.mkdir(@out_dir) unless File.exist?(@out_dir)
|
36
36
|
end
|
37
37
|
after :all do
|
38
38
|
@out_dir = File.expand_path(File.join(File.dirname(__FILE__), "../tmp/"))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webp-ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Vasyliev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -88,9 +88,9 @@ extensions:
|
|
88
88
|
- ext/webp_ffi/Rakefile
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
+
- ".github/workflows/build.yml"
|
91
92
|
- ".gitignore"
|
92
|
-
- ".
|
93
|
-
- ".travis.yml"
|
93
|
+
- ".tool-versions"
|
94
94
|
- CHANGELOG.md
|
95
95
|
- Gemfile
|
96
96
|
- LICENSE.txt
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- lib/webp/version.rb
|
116
116
|
- lib/webp/webp.rb
|
117
117
|
- lib/webp_ffi.rb
|
118
|
+
- spec/build.sh
|
118
119
|
- spec/factories/1.png
|
119
120
|
- spec/factories/1.webp
|
120
121
|
- spec/factories/2.png
|
@@ -126,7 +127,6 @@ files:
|
|
126
127
|
- spec/factories/5.tif
|
127
128
|
- spec/factories/5.webp
|
128
129
|
- spec/spec_helper.rb
|
129
|
-
- spec/travis_build.sh
|
130
130
|
- spec/webp_ffi_spec.rb
|
131
131
|
- webp-ffi.gemspec
|
132
132
|
homepage: http://leopard.in.ua/webp-ffi
|
@@ -148,11 +148,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
151
|
+
rubygems_version: 3.4.10
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Ruby wrapper for libwebp
|
155
155
|
test_files:
|
156
|
+
- spec/build.sh
|
156
157
|
- spec/factories/1.png
|
157
158
|
- spec/factories/1.webp
|
158
159
|
- spec/factories/2.png
|
@@ -164,5 +165,4 @@ test_files:
|
|
164
165
|
- spec/factories/5.tif
|
165
166
|
- spec/factories/5.webp
|
166
167
|
- spec/spec_helper.rb
|
167
|
-
- spec/travis_build.sh
|
168
168
|
- spec/webp_ffi_spec.rb
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.7.1
|
data/.travis.yml
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
before_install:
|
4
|
-
- ./spec/travis_build.sh > /dev/null 2>&1
|
5
|
-
- export LD_FLAGS=-L$HOME/opt/lib
|
6
|
-
- export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/lib
|
7
|
-
- export CPATH=$CPATH:$HOME/opt/include
|
8
|
-
|
9
|
-
rvm:
|
10
|
-
- 2.5
|
11
|
-
- 2.6
|
12
|
-
- 2.7
|
13
|
-
- 3.0
|
14
|
-
- jruby-19mode
|
15
|
-
- rbx-19mode
|
16
|
-
- ruby-head
|
17
|
-
- jruby-head
|
18
|
-
env:
|
19
|
-
- LIBWEBP_VERSION=0.4.4
|
20
|
-
- LIBWEBP_VERSION=1.0.2
|
21
|
-
|
22
|
-
cache: bundler
|
23
|
-
sudo: false
|
24
|
-
dist: xenial
|
25
|
-
|
26
|
-
notifications:
|
27
|
-
email: false
|
28
|
-
|
29
|
-
branches:
|
30
|
-
only:
|
31
|
-
- master
|
32
|
-
- development
|
33
|
-
|
34
|
-
matrix:
|
35
|
-
allow_failures:
|
36
|
-
- rvm: rbx-19mode
|
37
|
-
- rvm: ruby-head
|
38
|
-
- rvm: jruby-head
|
File without changes
|