blurhash_decoder 0.0.10 → 0.0.11
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 +4 -4
- data/blurhash_decoder.gemspec +1 -1
- data/ext/blurhash_encoder/blurhash_encoder.c +52 -0
- data/ext/blurhash_encoder/common.h +26 -0
- data/ext/blurhash_encoder/encode.c +116 -0
- data/ext/blurhash_encoder/encode.h +9 -0
- data/ext/blurhash_encoder/stb_image.h +7177 -0
- data/lib/blurhash_decoder/blurhash_decoder.bundle +0 -0
- data/lib/blurhash_encoder/blurhash_encoder.bundle +0 -0
- data/lib/blurhash_encoder.rb +16 -0
- metadata +9 -1
Binary file
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "blurhash_encoder/blurhash_encoder"
|
2
|
+
require 'open-uri'
|
3
|
+
|
4
|
+
|
5
|
+
class BlurhashEncoder
|
6
|
+
include ENCODER
|
7
|
+
VERSION = "1.0"
|
8
|
+
|
9
|
+
def blurhash(image_url, x, y)
|
10
|
+
File.write 'tmp/in.png', URI.open(image_url).read
|
11
|
+
encode(x,y)
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
# puts BlurhashEncoder.new.blurhash("http://m.gettywallpapers.com/wp-content/uploads/2021/06/Windows-11-Wallpaper.png", 4, 3)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blurhash_decoder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rabin Poudyal
|
@@ -26,8 +26,16 @@ files:
|
|
26
26
|
- ext/blurhash_decoder/blurhash_decoder.c
|
27
27
|
- ext/blurhash_decoder/extconf.rb
|
28
28
|
- ext/blurhash_decoder/stb_writer.h
|
29
|
+
- ext/blurhash_encoder/blurhash_encoder.c
|
30
|
+
- ext/blurhash_encoder/common.h
|
31
|
+
- ext/blurhash_encoder/encode.c
|
32
|
+
- ext/blurhash_encoder/encode.h
|
29
33
|
- ext/blurhash_encoder/extconf.rb
|
34
|
+
- ext/blurhash_encoder/stb_image.h
|
30
35
|
- lib/blurhash_decoder.rb
|
36
|
+
- lib/blurhash_decoder/blurhash_decoder.bundle
|
37
|
+
- lib/blurhash_encoder.rb
|
38
|
+
- lib/blurhash_encoder/blurhash_encoder.bundle
|
31
39
|
- run.sh
|
32
40
|
homepage: https://rubygems.org/gems/blurhash_decoder
|
33
41
|
licenses:
|