carrierwave 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of carrierwave might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a985080c1432e2d6d27cbe46b823f4ca5bdbc75
4
- data.tar.gz: e3e60a7159815499f0559f9574480633e73d68ed
3
+ metadata.gz: 35c836a3a970d4f900cc30a3a601199a629a8554
4
+ data.tar.gz: 22b99a337562f2be3c60731377de38b8a204d73f
5
5
  SHA512:
6
- metadata.gz: 9e027080e1e7fcc86a2f6e0b74cb0d4db2d1f955b733c9bf47354fb74da0707c0017a9305fdc6f090825a7203b319f25bcd61ecc2fa84f123da19a9b9d784d6c
7
- data.tar.gz: 2c8d16ca3353952282e9ffb97d37d44477c5a22f4744f99a84d0fde7bc0ee9d6b456698aa386d0664e8b734f9b8edf155a8034b15efb5b60831579a610d09b67
6
+ metadata.gz: f4602848d9c82f60537acb7e3cfaa0ca7bdffe0a0d737224b62400e52c52277109ee1090aa148755ba5ba84f11fa5cdd11bc4209c533cf5c1df7475feda2ad66
7
+ data.tar.gz: 95e296300604fc0d41013302cd667d5713f56cb5faa64e5f2ff4d43708e04fdd59c1df6c55414848f526f5eb56618923de9d2a177fb5e2f49be62b383e95b085
data/README.md CHANGED
@@ -301,8 +301,16 @@ end
301
301
  ```
302
302
 
303
303
  When this uploader is used, an uploaded image would be scaled to be no larger
304
- than 800 by 800 pixels. A version called thumb is then created, which is scaled
305
- and cropped to exactly 200 by 200 pixels. The uploader could be used like this:
304
+ than 800 by 800 pixels. The original aspect ratio will be kept.
305
+ A version called thumb is then created, which is scaled
306
+ to exactly 200 by 200 pixels.
307
+
308
+ If you would like to crop images to a specific height and width you
309
+ can use the alternative option of '''resize_to_fill'''. It will make sure
310
+ that the width and height specified are filled, only copping
311
+ if the aspect ratio requires it.
312
+
313
+ The uploader could be used like this:
306
314
 
307
315
  ```ruby
308
316
  uploader = AvatarUploader.new
@@ -665,9 +673,9 @@ CarrierWave.configure do |config|
665
673
  host: 's3.example.com', # optional, defaults to nil
666
674
  endpoint: 'https://s3.example.com:8080' # optional, defaults to nil
667
675
  }
668
- config.fog_directory = 'name_of_directory' # required
669
- config.fog_public = false # optional, defaults to true
670
- config.fog_attributes = { cache_control: "public, max-age=#{365.day.to_i}" } # optional, defaults to {}
676
+ config.fog_directory = 'name_of_directory' # required
677
+ config.fog_public = false # optional, defaults to true
678
+ config.fog_attributes = { cache_control: "public, max-age=#{365.days.to_i}" } # optional, defaults to {}
671
679
  end
672
680
  ```
673
681
 
@@ -303,6 +303,7 @@ module CarrierWave
303
303
 
304
304
  if @format
305
305
  move_to = current_path.chomp(File.extname(current_path)) + ".#{@format}"
306
+ file.content_type = ::MIME::Types.type_for(move_to).first.to_s
306
307
  file.move_to(move_to, permissions, directory_permissions)
307
308
  end
308
309
 
@@ -356,6 +356,7 @@ module CarrierWave
356
356
  if options[:format] || @format
357
357
  frames.write("#{options[:format] || @format}:#{current_path}", &write_block)
358
358
  move_to = current_path.chomp(File.extname(current_path)) + ".#{options[:format] || @format}"
359
+ file.content_type = ::MIME::Types.type_for(move_to).first.to_s
359
360
  file.move_to(move_to, permissions, directory_permissions)
360
361
  else
361
362
  frames.write(current_path, &write_block)
@@ -1,3 +1,3 @@
1
1
  module CarrierWave
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -1,5 +1,4 @@
1
1
  class <%= class_name %>Uploader < CarrierWave::Uploader::Base
2
-
3
2
  # Include RMagick or MiniMagick support:
4
3
  # include CarrierWave::RMagick
5
4
  # include CarrierWave::MiniMagick
@@ -45,5 +44,4 @@ class <%= class_name %>Uploader < CarrierWave::Uploader::Base
45
44
  # def filename
46
45
  # "something.jpg" if original_filename
47
46
  # end
48
-
49
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2018-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport