photofy 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/photofy/core.rb +4 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a744f1bb4fd9e6efca164afb9dab6ea4e7df6ee
4
- data.tar.gz: ac768ff6eb8eb754091e37053895411af39a1944
3
+ metadata.gz: cef8d8eda2238ff40d18654a512b4fc390f8274f
4
+ data.tar.gz: 2ced3eb2cfa2c3905f2c25f963ab4b649bb66bde
5
5
  SHA512:
6
- metadata.gz: 23437c98c6b9d282aae99cca8e681be25b75e5695e06f4bd5a57ac668c85f86690daa94852a091a5dcfc5a6c9aa4f9a0bb617344273644a7df7c5880d289644c
7
- data.tar.gz: 21e77488af9a5801a8821ad1c9395aba5ab77c1c1af718bf31b83088056c3df87dab51e0cd26a7aeee1ea8dc1be4261dad2567e2f2705e366dbd110d2b2a7acd
6
+ metadata.gz: e5bcb32f161c79f03ba4bcc6e0968c201ff2d2626a5d33bd858b9f2743e36828f12c2a1823d8cdc2d6d4e6372444e3089b870b7705d1bd471fd501f7299257ea
7
+ data.tar.gz: 39b8f98f11603c418dd15ea740defe4aee550ce0c644b7f8f6c3b6c01e28fd3cfd3acfd85db86c423c4fda13da0250b5b75e8f33b6662c6bb96a03ab525a0fda
@@ -151,11 +151,12 @@ module Photofy
151
151
 
152
152
  file_upload.rewind
153
153
  elsif file_upload.class == String
154
+ file_upload_processed = file_upload.strip.chomp
154
155
 
155
156
  # For handling base 64 encoded image
156
- if file_upload.match(/\Adata:([-\w]+\/[-\w\+\.]+)?;base64,/)
157
- file_upload_parts = file_upload.match(/\Adata:([-\w]+\/[-\w\+\.]+)?;base64,(.*)/m) || []
158
- extension = MIME::Types[file_upload_parts[1]].first.preferred_extension
157
+ if file_upload_processed.match(/\Adata:([-\w]+\/[-\w\+\.]+)?;base64,/)
158
+ file_upload_parts = file_upload_processed.match(/\Adata:([-\w]+\/[-\w\+\.]+)?;base64,(.*)/m) || []
159
+ extension = Mime::Type.lookup(file_upload_parts[1]).symbol.to_s
159
160
 
160
161
  unless self.class.photo_formats[photo_field].include?(".#{extension}")
161
162
  (@photo_fields_errors ||= {})[photo_field.to_sym] = options[:message]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: photofy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Praveen Kumar Sinha
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  requirements: []
48
48
  rubyforge_project:
49
- rubygems_version: 2.6.12
49
+ rubygems_version: 2.6.14
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: Photofy