kamifusen 1.7 → 1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/views/kamifusen/_view.html.erb +7 -5
- data/lib/kamifusen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05b8beb4ef9751b96229c3b9d267a9c6fc99f34d4bb869228495ce51779b06e0
|
4
|
+
data.tar.gz: 879e686e9b394b0b34aecabaa35469ffc063c4c815fbd6b92fabc226c2fc6894
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cf81c743cf040ed1beb800be796fbbdc9883d75efbea3ed17951598fcd32d2dbe095235fbe7d2d568a320de1a7a476d0889eea737dd1b3d7531fe667790d804
|
7
|
+
data.tar.gz: 0ccb61359dbe83cca6b6ae7a6c1a27fae0e0d52616d448582de9314deb8a1964e4fd5c1b23d11d4f3908cef7c0476813ab47dc1b8e2892b4ac9dcda8cf6259a9
|
data/Gemfile.lock
CHANGED
@@ -10,6 +10,11 @@ klass = options[:class]
|
|
10
10
|
picture_class = options[:picture_class]
|
11
11
|
width = options[:width]
|
12
12
|
height = options[:height]
|
13
|
+
|
14
|
+
# kamifusen settings
|
15
|
+
sizes = [360, 375, 414, 576, 640, 750, 768, 828, 992, 1152, 1200, 1366, 1400, 1536, 1920, 1984, 2400]
|
16
|
+
quality = 80
|
17
|
+
|
13
18
|
if source&.metadata &&
|
14
19
|
source.metadata['analyzed'] &&
|
15
20
|
source.metadata.has_key?('width') &&
|
@@ -19,8 +24,8 @@ if source&.metadata &&
|
|
19
24
|
image_ratio = 1.0 * image_width / image_height
|
20
25
|
if width.nil? && height.nil?
|
21
26
|
# Prendre width et height réelles de l'image
|
22
|
-
width = image_width
|
23
|
-
height =
|
27
|
+
width = [image_width, sizes.last].min
|
28
|
+
height = width * image_ratio
|
24
29
|
elsif width.nil?
|
25
30
|
# Calculer la height sur ratio
|
26
31
|
width = height * image_ratio
|
@@ -62,9 +67,6 @@ end
|
|
62
67
|
<% if source.variable? %>
|
63
68
|
<%#= "#{image_width} x #{image_height}, #{image_ratio} ratio => #{width} x #{height}<br>".html_safe %>
|
64
69
|
<%
|
65
|
-
# kamifusen settings
|
66
|
-
sizes = [360, 375, 414, 576, 640, 750, 768, 828, 992, 1152, 1200, 1366, 1400, 1536, 1920, 1984, 2400]
|
67
|
-
quality = 80
|
68
70
|
# Computing
|
69
71
|
if width
|
70
72
|
width_retina = width * 2
|
data/lib/kamifusen/version.rb
CHANGED