libjpeg-ruby 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f282952f089529770d21cff48005d0f9bb3c6b2e5de455bcf0d790c534352f96
4
- data.tar.gz: 8e108130fd9a5c5fcf2b1fbdd63f3920ab17e37a1d0713abc9b38ac85dc33d19
3
+ metadata.gz: da83aa3f76a6f55060e85d47cf49a48ddd393258ce6a005453e32ddcebceeb33
4
+ data.tar.gz: 0b2b2a6883fd79b6c5da01e9f6098de826a5320ec325f555cf8a2cc2d3e21c55
5
5
  SHA512:
6
- metadata.gz: 70a9a93564144bfd271139316ef2b1b3456516d92b860d7bcf4574503b5393b9d228194948a7651ff53b7e970384ab228a29cac29516082862e06d20e9d5fefd
7
- data.tar.gz: df0519c734dd9e1083e29407224fd2cb65a24e9532e90d7f83792179e23a79176c3196b968454f0864baf64e64606561ea2181837fce67936cd1f4568803d1bc
6
+ metadata.gz: 88d8c21a50e6164a3751e4edf67441fa93610b8fd1e06a8186890abca84b1e7aaca577498cd7de63dc35d383f6f9c185f94f1fd650b68de6d32defabe9b15e27
7
+ data.tar.gz: 63fdff905d2fdc9a3496149499e3b877fa6bdd07f19fae36464ca7e8f3a2e638cd81f25c6bd08e32bde1567e28a28e191bdda8ca2ccac9df57a850e8fc42964c
data/README.md CHANGED
@@ -51,6 +51,7 @@ IO.binwrite("test.bgr", raw)
51
51
  | :scale | Rational or Float | T.B.D |
52
52
  | :dct_method | String or Symbol | T.B.D |
53
53
  | :with_exif | Boolean | Specify whether to read Exif tag. When set to true, the content of Exif tag will included in the meta information. |
54
+ | :orientation | Boolean | Specify whether to parse Exif orientation. When set to true, apply orientation for decode result. |
54
55
 
55
56
  #### supported output format
56
57
  RGB RGB24 YUV422 YUYV RGB565 YUV444 YCbCr BGR BGR24 RGBX RGB32 BGRX BGR32
@@ -75,4 +76,5 @@ IO.binwrite("test.jpg", enc << IO.binread("test.raw"))
75
76
  | :quality | Integer | encode quality (0-100) |
76
77
  | :scale | Rational or Float | |
77
78
  | :dct_method | String or Symbol | T.B.D |
79
+ | :orientation | Integer | Specify Exif orientation value (1-8). |
78
80
 
@@ -905,10 +905,21 @@ static void
905
905
  rb_decoder_free(void* ptr)
906
906
  {
907
907
  //jpeg_destroy_decompress(&(((jpeg_decode_t*)ptr)->cinfo));
908
-
909
908
  free(ptr);
910
909
  }
911
910
 
911
+ static void
912
+ rb_decoder_mark(void* _ptr)
913
+ {
914
+ jpeg_decode_t* ptr;
915
+
916
+ ptr = (jpeg_decode_t*)_ptr;
917
+
918
+ if (ptr->orientation.buf != Qnil) {
919
+ rb_gc_mark(ptr->orientation.buf);
920
+ }
921
+ }
922
+
912
923
  static void
913
924
  decode_output_message(j_common_ptr cinfo)
914
925
  {
@@ -983,7 +994,7 @@ rb_decoder_alloc(VALUE self)
983
994
  ptr->orientation.value = 0;
984
995
  ptr->orientation.buf = Qnil;
985
996
 
986
- return Data_Wrap_Struct(decoder_klass, 0, rb_decoder_free, ptr);
997
+ return Data_Wrap_Struct(decoder_klass, rb_decoder_mark, rb_decoder_free, ptr);
987
998
  }
988
999
 
989
1000
  static void
@@ -2315,6 +2326,10 @@ do_read_header(jpeg_decode_t* ptr, uint8_t* jpg, size_t jpg_sz)
2315
2326
  jpeg_read_header(&ptr->cinfo, TRUE);
2316
2327
  jpeg_calc_output_dimensions(&ptr->cinfo);
2317
2328
 
2329
+ if (TEST_FLAG(ptr, F_APPLY_ORIENTATION)) {
2330
+ pick_exif_orientation(ptr);
2331
+ }
2332
+
2318
2333
  ret = create_meta(ptr);
2319
2334
 
2320
2335
  jpeg_destroy_decompress(&ptr->cinfo);
@@ -1,3 +1,3 @@
1
1
  module JPEG
2
- VERSION = "0.7.2"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libjpeg-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Kuwagata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-14 00:00:00.000000000 Z
11
+ date: 2019-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler