gdk_pixbuf2 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/dependency-check/Rakefile +1 -2
- data/lib/gdk_pixbuf2/pixbuf.rb +19 -3
- data/test/test-pixbuf.rb +22 -5
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: d372c1d54b1ba0d1a4e8dc171d7d6ddb0d0583ff8569524c6b0440a18a9943e8
|
|
4
|
+
data.tar.gz: f37e5fd9b4e19cdae8da510f801a5134b866ce450815a2f837c8b56d2f155da7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f39ab55eeb80eea4d782e8d1dc5028c4b8c1a4a93652633096331a912395986924da8b68510071734155cd86d9c7fd460c4bd543e24762bb786924228a87a91a
|
|
7
|
+
data.tar.gz: 5f2d2fec65a512b5cc0d2ff9af78e2d7fb03d88e5428695f10a50c6f9553f4c4e3f2d24d1f9b3c9d5d4b21fd530bd7edc22233037fbbfcb291c1bbe7269be7b8
|
data/dependency-check/Rakefile
CHANGED
|
@@ -32,8 +32,7 @@ namespace :dependency do
|
|
|
32
32
|
unless PKGConfig.check_version?("gdk-pixbuf-2.0")
|
|
33
33
|
unless NativePackageInstaller.install(:altlinux => "gdk-pixbuf-devel",
|
|
34
34
|
:debian => "libgdk-pixbuf2.0-dev",
|
|
35
|
-
:redhat => "
|
|
36
|
-
:fedora => "gdk-pixbuf2-devel",
|
|
35
|
+
:redhat => "pkgconfig(gdk-pixbuf-2.0)",
|
|
37
36
|
:arch => "gdk-pixbuf2",
|
|
38
37
|
:homebrew => "gdk-pixbuf",
|
|
39
38
|
:macports => "gdk-pixbuf2",
|
data/lib/gdk_pixbuf2/pixbuf.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2016-
|
|
1
|
+
# Copyright (C) 2016-2018 Ruby-GNOME2 Project Team
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -170,6 +170,8 @@ module GdkPixbuf
|
|
|
170
170
|
:initialize_new_from_file_at_scale_utf8
|
|
171
171
|
end
|
|
172
172
|
|
|
173
|
+
alias_method :row_stride, :rowstride
|
|
174
|
+
|
|
173
175
|
def dup
|
|
174
176
|
copy
|
|
175
177
|
end
|
|
@@ -223,8 +225,22 @@ module GdkPixbuf
|
|
|
223
225
|
def save(*args)
|
|
224
226
|
case args.size
|
|
225
227
|
when 1
|
|
226
|
-
|
|
227
|
-
|
|
228
|
+
arg1 = args[0]
|
|
229
|
+
if arg1.respond_to?(:to_path)
|
|
230
|
+
filename = arg1.to_path
|
|
231
|
+
elsif arg1.is_a?(String) and arg1.include?(".")
|
|
232
|
+
filename = args[0]
|
|
233
|
+
else
|
|
234
|
+
filename = nil
|
|
235
|
+
type = arg1
|
|
236
|
+
end
|
|
237
|
+
if filename
|
|
238
|
+
type = File.extname(filename).gsub(/\A\./, "").downcase
|
|
239
|
+
case type
|
|
240
|
+
when "jpg"
|
|
241
|
+
type = "jpeg"
|
|
242
|
+
end
|
|
243
|
+
end
|
|
228
244
|
options = {}
|
|
229
245
|
when 2
|
|
230
246
|
if args.last.is_a?(Hash)
|
data/test/test-pixbuf.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (C) 2016-
|
|
1
|
+
# Copyright (C) 2016-2018 Ruby-GNOME2 Project Team
|
|
2
2
|
#
|
|
3
3
|
# This library is free software; you can redistribute it and/or
|
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
|
@@ -105,7 +105,7 @@ class TestPixbuf < Test::Unit::TestCase
|
|
|
105
105
|
src_pixbuf.bits_per_sample,
|
|
106
106
|
src_pixbuf.width,
|
|
107
107
|
src_pixbuf.height,
|
|
108
|
-
src_pixbuf.
|
|
108
|
+
src_pixbuf.row_stride,
|
|
109
109
|
)
|
|
110
110
|
assert_equal(src_pixbuf.pixels, pixbuf.pixels)
|
|
111
111
|
end
|
|
@@ -188,7 +188,7 @@ class TestPixbuf < Test::Unit::TestCase
|
|
|
188
188
|
:bits_per_sample => src_pixbuf.bits_per_sample,
|
|
189
189
|
:width => src_pixbuf.width,
|
|
190
190
|
:height => src_pixbuf.height,
|
|
191
|
-
:row_stride => src_pixbuf.
|
|
191
|
+
:row_stride => src_pixbuf.row_stride,
|
|
192
192
|
)
|
|
193
193
|
assert_equal(src_pixbuf.pixels, pixbuf.pixels)
|
|
194
194
|
end
|
|
@@ -204,7 +204,7 @@ class TestPixbuf < Test::Unit::TestCase
|
|
|
204
204
|
:bits_per_sample => src_pixbuf.bits_per_sample,
|
|
205
205
|
:width => src_pixbuf.width,
|
|
206
206
|
:height => src_pixbuf.height,
|
|
207
|
-
:row_stride => src_pixbuf.
|
|
207
|
+
:row_stride => src_pixbuf.row_stride,
|
|
208
208
|
)
|
|
209
209
|
assert_equal(src_pixbuf.pixels, pixbuf.pixels)
|
|
210
210
|
end
|
|
@@ -269,7 +269,7 @@ class TestPixbuf < Test::Unit::TestCase
|
|
|
269
269
|
filename = fixture_path("gnome-logo-icon.png")
|
|
270
270
|
pixbuf = GdkPixbuf::Pixbuf.new(:file => filename)
|
|
271
271
|
pixbuf.fill!(0xffffffff)
|
|
272
|
-
assert_equal([0xff] * (pixbuf.
|
|
272
|
+
assert_equal([0xff] * (pixbuf.row_stride * pixbuf.height),
|
|
273
273
|
pixbuf.pixels)
|
|
274
274
|
end
|
|
275
275
|
|
|
@@ -361,6 +361,15 @@ class TestPixbuf < Test::Unit::TestCase
|
|
|
361
361
|
Gio::ContentType.guess(nil, jpeg))
|
|
362
362
|
end
|
|
363
363
|
|
|
364
|
+
test("filename") do
|
|
365
|
+
png_filename = fixture_path("gnome-logo-icon.png")
|
|
366
|
+
pixbuf = GdkPixbuf::Pixbuf.new(:file => png_filename)
|
|
367
|
+
output = Tempfile.new(["pixbuf", ".jpg"])
|
|
368
|
+
pixbuf.save(output)
|
|
369
|
+
assert_equal(["image/jpeg", false],
|
|
370
|
+
Gio::ContentType.guess(nil, output.read))
|
|
371
|
+
end
|
|
372
|
+
|
|
364
373
|
test(":filename") do
|
|
365
374
|
png_filename = fixture_path("gnome-logo-icon.png")
|
|
366
375
|
pixbuf = GdkPixbuf::Pixbuf.new(:file => png_filename)
|
|
@@ -380,4 +389,12 @@ class TestPixbuf < Test::Unit::TestCase
|
|
|
380
389
|
assert_equal(["image/jpeg", false],
|
|
381
390
|
Gio::ContentType.guess(nil, jpeg))
|
|
382
391
|
end
|
|
392
|
+
|
|
393
|
+
test("#read_pixel_bytes") do
|
|
394
|
+
only_version(2, 32)
|
|
395
|
+
png_filename = fixture_path("gnome-logo-icon.png")
|
|
396
|
+
pixbuf = GdkPixbuf::Pixbuf.new(:file => png_filename)
|
|
397
|
+
assert_equal(pixbuf.pixels.pack("C*"),
|
|
398
|
+
pixbuf.read_pixel_bytes.to_s)
|
|
399
|
+
end
|
|
383
400
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gdk_pixbuf2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.2.
|
|
4
|
+
version: 3.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Ruby-GNOME2 Project Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-04-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: gio2
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - '='
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 3.2.
|
|
19
|
+
version: 3.2.2
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - '='
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 3.2.
|
|
26
|
+
version: 3.2.2
|
|
27
27
|
description: Ruby/GdkPixbuf2 is a Ruby binding of GdkPixbuf-2.x.
|
|
28
28
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
|
29
29
|
executables: []
|
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
81
81
|
version: '0'
|
|
82
82
|
requirements: []
|
|
83
83
|
rubyforge_project:
|
|
84
|
-
rubygems_version: 2.
|
|
84
|
+
rubygems_version: 2.7.6
|
|
85
85
|
signing_key:
|
|
86
86
|
specification_version: 4
|
|
87
87
|
summary: Ruby/GdkPixbuf2 is a Ruby binding of GdkPixbuf-2.x.
|