kamifusen 1.7 → 1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc7dc54c21db20fd2cfd6a7aec2c5b50aa7ee13f725648293246a5972f973240
4
- data.tar.gz: 0f6d32fbe3006abc1d018916b66a71dbd20bd9e9edacf11ea5c4e841e446e5ca
3
+ metadata.gz: 05b8beb4ef9751b96229c3b9d267a9c6fc99f34d4bb869228495ce51779b06e0
4
+ data.tar.gz: 879e686e9b394b0b34aecabaa35469ffc063c4c815fbd6b92fabc226c2fc6894
5
5
  SHA512:
6
- metadata.gz: ae20b1464beb842cc4a17275b2d154a3bf572405b8c7a97be7acd57e91245571460fbac7fdefff62e380cd0a6a21e6fb863df950d6f4d2552cde7a3faa80acd8
7
- data.tar.gz: d120ad3e78b7094c352874b7fbafd611a6017eeef5cb2e621879e0863f310ef5a512b7ac58126c51d344647d40cc069837f7aa94a34c05af8733a1c40c5e1fac
6
+ metadata.gz: 9cf81c743cf040ed1beb800be796fbbdc9883d75efbea3ed17951598fcd32d2dbe095235fbe7d2d568a320de1a7a476d0889eea737dd1b3d7531fe667790d804
7
+ data.tar.gz: 0ccb61359dbe83cca6b6ae7a6c1a27fae0e0d52616d448582de9314deb8a1964e4fd5c1b23d11d4f3908cef7c0476813ab47dc1b8e2892b4ac9dcda8cf6259a9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kamifusen (1.7)
4
+ kamifusen (1.8)
5
5
  image_processing
6
6
  rails
7
7
 
@@ -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 = image_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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kamifusen
4
- VERSION = "1.7"
4
+ VERSION = "1.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamifusen
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.7'
4
+ version: '1.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Moulène