1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
Description: Favor usage of FreeImage_Rotate instead of FreeImage_RotateClassic
fix for freeimage >= 3.18
From: Ivan Etchart <ivan.etchart@me.com>
Date: Fri, 24 Aug 2018 11:02:08 -0300
Origin: https://github.com/seattlerb/image_science/pull/27/commits/4a28665b01d07c48b1cc690f82d3da24079c4083
It won't work on FreeImage 3.18. It's still supported in older versions but deprecated
---
lib/image_science.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/image_science.rb b/lib/image_science.rb
index 9b8d5f1..20c4f0a 100755
--- a/lib/image_science.rb
+++ b/lib/image_science.rb
@@ -191,13 +191,13 @@ def cropped_thumbnail(size) # :yields: image
FreeImage_GetMetadata(FIMD_EXIF_MAIN, bitmap, "Orientation", &tagValue);
switch (tagValue == NULL ? 0 : *((short *) FreeImage_GetTagValue(tagValue))) {
case 6:
- bitmap = FreeImage_RotateClassic(bitmap, 270);
+ bitmap = FreeImage_Rotate(bitmap, 270, NULL);
break;
case 3:
- bitmap = FreeImage_RotateClassic(bitmap, 180);
+ bitmap = FreeImage_Rotate(bitmap, 180, NULL);
break;
case 8:
- bitmap = FreeImage_RotateClassic(bitmap, 90);
+ bitmap = FreeImage_Rotate(bitmap, 90, NULL);
break;
default:
bitmap = FreeImage_Clone(bitmap);
@@ -321,7 +321,7 @@ def cropped_thumbnail(size) # :yields: image
FIBITMAP *bitmap, *image;
if ((angle % 45) != 0) rb_raise(rb_eArgError, "Angle must be 45 degree skew");
GET_BITMAP(bitmap);
- image = FreeImage_RotateClassic(bitmap, angle);
+ image = FreeImage_Rotate(bitmap, angle, NULL);
if (image) {
copy_icc_profile(self, bitmap, image);
return wrap_and_yield(image, self, 0);
|