dynamic_image 2.0.25 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/dynamic_image.rb +1 -0
- data/lib/dynamic_image/image_reader.rb +11 -1
- data/lib/dynamic_image/processed_image.rb +8 -1
- data/lib/dynamic_image/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd1d723cd97a91199630354e541d2a740aa41bae8ccb07554c1e723096a1b6dc
|
4
|
+
data.tar.gz: b4f5a8bf26b69da95543cb8885f5add2b72504ea88f83c4097bc1c25a13c622f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2ba7e0be3c929f9da2b1c7311ae7a246341f081cc8057e8293417a8a73634ec5844d0ce7a691c3d5c771d99924b311c59a2a9b9bf2e2baae84675a3967a8614
|
7
|
+
data.tar.gz: '08cfc8124f2d6e2bd9d505315b1af7ed87e42ae4ff497a88fafd240e9594943721a6f72e7f196d5dffb1a43a1c8489e9b1b427e4042e149aedcf21a22f0506ba'
|
data/README.md
CHANGED
data/lib/dynamic_image.rb
CHANGED
@@ -21,6 +21,12 @@ module DynamicImage
|
|
21
21
|
@data = data
|
22
22
|
end
|
23
23
|
|
24
|
+
def exif
|
25
|
+
raise DynamicImage::Errors::InvalidHeader unless valid_header?
|
26
|
+
|
27
|
+
MiniExiftool.new(string_io)
|
28
|
+
end
|
29
|
+
|
24
30
|
def read
|
25
31
|
raise DynamicImage::Errors::InvalidHeader unless valid_header?
|
26
32
|
|
@@ -39,7 +45,11 @@ module DynamicImage
|
|
39
45
|
private
|
40
46
|
|
41
47
|
def file_header
|
42
|
-
@file_header ||=
|
48
|
+
@file_header ||= string_io.read(8)
|
49
|
+
end
|
50
|
+
|
51
|
+
def string_io
|
52
|
+
StringIO.new(@data, "rb")
|
43
53
|
end
|
44
54
|
end
|
45
55
|
end
|
@@ -90,7 +90,10 @@ module DynamicImage
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def convert_to_srgb(image, combined)
|
93
|
-
|
93
|
+
if image.data["profiles"].present? &&
|
94
|
+
exif.colorspacedata&.strip&.downcase == record.colorspace
|
95
|
+
combined.profile(srgb_profile)
|
96
|
+
end
|
94
97
|
combined.colorspace("sRGB") if record.cmyk?
|
95
98
|
end
|
96
99
|
|
@@ -111,6 +114,10 @@ module DynamicImage
|
|
111
114
|
end
|
112
115
|
end
|
113
116
|
|
117
|
+
def exif
|
118
|
+
@exif ||= DynamicImage::ImageReader.new(record.data).exif
|
119
|
+
end
|
120
|
+
|
114
121
|
def format
|
115
122
|
@format ||= record_format
|
116
123
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic_image
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inge Jørgensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dis
|
@@ -30,6 +30,20 @@ dependencies:
|
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.0.6
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: mini_exiftool
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '2.10'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '2.10'
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: mini_magick
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|