blurhash_decoder 0.0.9 → 0.0.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 349d523e56561bcd00f280f5233a8cebcc6148844eeee700a34435a10c135936
4
- data.tar.gz: 3eb0a9ba6a617792e71edca78e0c5e8d9a91da820ab777241f74614db914cdc0
3
+ metadata.gz: 68941f08272cb7b00dab2261afc755cd8833f67e3407f75d1eca45a4c765938b
4
+ data.tar.gz: 7d641afcd4a5ee0366112268f3c7a4d3d8a078c90f478118116a0dc1f9360595
5
5
  SHA512:
6
- metadata.gz: 17255f0b13802b7fc8278bfea568746ec75fa43f948d45b9b5daef728e3ebf4d25fbbe1b27667830b58ff7627534a1456c06c50ee4cbb6478f72f5f25a71c9b4
7
- data.tar.gz: f40f7c1ac6db184ddf2a2b3f93cd3de9816fa664d8580e17fbf19449edb9c70132b07d69298922a6897ba17d778aad6c771f773d741908696d6c25ed78d28388
6
+ metadata.gz: b8476b070ae0f36d0f7369998fe8cd672ec92a80f5347c48cf03db2073c12ddad3f6a2f1d5e4df328bb6c79b942a1d604c5f6a68e37bf070973d649680f4be66
7
+ data.tar.gz: '0813bb02a43ca11415eb9bc087446a5f6bc8a4b5be13d29cb03c6cd248ddd042e322132210dc29f000cce1dd809091af733c3074c32ac2bdf58c9a28a8afead5'
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  tmp
2
2
  lib/stuart_geo/*.bundle
3
- lib/stuart_geo/*.so
3
+ lib/stuart_geo/*.so
4
+ *.gem
data/Rakefile CHANGED
@@ -2,4 +2,8 @@ require "rake/extensiontask"
2
2
 
3
3
  Rake::ExtensionTask.new "blurhash_decoder" do |ext|
4
4
  ext.lib_dir = 'lib/blurhash_decoder'
5
+ end
6
+
7
+ Rake::ExtensionTask.new "blurhash_encoder" do |ext|
8
+ ext.lib_dir = 'lib/blurhash_encoder'
5
9
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'blurhash_decoder'
6
- s.version = '0.0.9'
6
+ s.version = '0.0.10'
7
7
  s.summary = "A blurhash decoder gem!"
8
8
  s.description = "A simple blurhash decoder gem using c."
9
9
  s.authors = ["Rabin Poudyal"]
@@ -13,5 +13,5 @@ Gem::Specification.new do |s|
13
13
  s.homepage =
14
14
  'https://rubygems.org/gems/blurhash_decoder'
15
15
  s.license = 'MIT'
16
- s.extensions = %w[ext/blurhash_decoder/extconf.rb]
16
+ s.extensions = %w[ext/blurhash_decoder/extconf.rb ext/blurhash_encoder/extconf.rb]
17
17
  end
@@ -0,0 +1,6 @@
1
+ require "mkmf"
2
+
3
+ abort "missing malloc()" unless have_func "malloc"
4
+ abort "missing free()" unless have_func "free"
5
+
6
+ create_makefile("blurhash_encoder/blurhash_encoder")
@@ -1,8 +1,12 @@
1
1
  require "blurhash_decoder/blurhash_decoder"
2
+ require "blurhash_encoder/blurhash_encoder"
2
3
  require 'base64'
4
+ require 'open-uri'
5
+
3
6
 
4
7
  class BlurhashDecoder
5
8
  include DECODER
9
+ #include ENCODER
6
10
  VERSION = "1.0"
7
11
 
8
12
  def decode_blurhash(blurhash, height, width, punch)
@@ -12,6 +16,12 @@ class BlurhashDecoder
12
16
  end
13
17
  base64_image
14
18
  end
19
+
20
+ def blurhash(image_url)
21
+ File.write 'tmp/in.png', open(image_url).read
22
+ encode(4,3)
23
+ end
24
+
15
25
  end
16
26
 
17
- # puts BlurhashDecoder.new.decode_blurhash("LEAclNah=_xC0K%LInWo9tE2jvNH", 2, 5, 1)
27
+ puts BlurhashDecoder.new.decode_blurhash("LEAclNah=_xC0K%LInWo9tE2jvNH", 2, 5, 1)
metadata CHANGED
@@ -1,20 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blurhash_decoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rabin Poudyal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-28 00:00:00.000000000 Z
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple blurhash decoder gem using c.
14
14
  email: rabin@trip101.com
15
15
  executables: []
16
16
  extensions:
17
17
  - ext/blurhash_decoder/extconf.rb
18
+ - ext/blurhash_encoder/extconf.rb
18
19
  extra_rdoc_files: []
19
20
  files:
20
21
  - ".gitignore"
@@ -25,6 +26,7 @@ files:
25
26
  - ext/blurhash_decoder/blurhash_decoder.c
26
27
  - ext/blurhash_decoder/extconf.rb
27
28
  - ext/blurhash_decoder/stb_writer.h
29
+ - ext/blurhash_encoder/extconf.rb
28
30
  - lib/blurhash_decoder.rb
29
31
  - run.sh
30
32
  homepage: https://rubygems.org/gems/blurhash_decoder