rfreeimage 0.1.3 → 0.1.5

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
  SHA1:
3
- metadata.gz: da114f86318598af6b06aa737c0fed85bf78887a
4
- data.tar.gz: 662cebc27f59581a9629a1dc95ad834577d3f76b
3
+ metadata.gz: 3037632a027335cbbed19c60769235c56713f77d
4
+ data.tar.gz: 1d1994a1051e7b32cd16e7277a61a3e1829a286f
5
5
  SHA512:
6
- metadata.gz: 24f80a22be77f83cbaf072b5d755f58fd0758eb17f3bb1dfff4ac4497c5d55a3da6c9c64341f999814a7ae469020a0a76aacc9adf142ba663ab217ae25acbb23
7
- data.tar.gz: 07af6587e3247f9e74db0cab5471a34571fecef781704c58e675b27a1a463dcd8564de14f7394d38f038408b041b46f6047a7c50c7b4b561b9d19ab02f165d8c
6
+ metadata.gz: 1fc05e814346fa10af49cc04ad96b4cc31958a3bb289a0ccd50839817c1eb0339b52001db7232db0d861aae828e3d01289a7f2cf2320e4fd9690da72537bdc8f
7
+ data.tar.gz: d5af3bb4a6f892e2afeacaefdcf0f1d9a61685c9db92f7c4f78905d00a0cce5ca7213a32c15d3b0e4e854783eb9fc0cbb7f8f2bfd84bfd715a634081ec6f9a70
@@ -101,7 +101,9 @@ rd_image(VALUE clazz, VALUE file, struct native_image *img, unsigned int bpp, BO
101
101
  }
102
102
 
103
103
  if (ping) flags |= FIF_LOAD_NOPIXELS;
104
- if (in_fif == FIF_JPEG) flags |= JPEG_EXIFROTATE;
104
+ // use JPEG_ACCURATE to keep sync with opencv
105
+ if (in_fif == FIF_JPEG)
106
+ flags |= JPEG_EXIFROTATE | JPEG_ACCURATE;
105
107
  orig = FreeImage_Load(in_fif, filename, flags);
106
108
  free(filename);
107
109
  if (!orig)
@@ -127,6 +129,7 @@ rd_image_blob(VALUE clazz, VALUE blob, struct native_image *img, unsigned int bp
127
129
  {
128
130
  FIBITMAP *h = NULL, *orig = NULL;
129
131
  FIMEMORY *fmh;
132
+ int flags = 0;
130
133
  FREE_IMAGE_FORMAT in_fif;
131
134
 
132
135
  Check_Type(blob, T_STRING);
@@ -138,7 +141,10 @@ rd_image_blob(VALUE clazz, VALUE blob, struct native_image *img, unsigned int bp
138
141
  rb_raise(rb_eIOError, "Invalid image blob");
139
142
  }
140
143
 
141
- orig = FreeImage_LoadFromMemory(in_fif, fmh, ping ? FIF_LOAD_NOPIXELS : 0 );
144
+ if (ping) flags |= FIF_LOAD_NOPIXELS;
145
+ if (in_fif == FIF_JPEG)
146
+ flags |= JPEG_EXIFROTATE | JPEG_ACCURATE;
147
+ orig = FreeImage_LoadFromMemory(in_fif, fmh, flags);
142
148
  FreeImage_CloseMemory(fmh);
143
149
  if (!orig)
144
150
  rb_raise(rb_eIOError, "Fail to load image from memory");
@@ -1,3 +1,3 @@
1
1
  module RFreeImage
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfreeimage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuheng Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2015-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler