photofy 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/photofy/core.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cef8d8eda2238ff40d18654a512b4fc390f8274f
|
4
|
+
data.tar.gz: 2ced3eb2cfa2c3905f2c25f963ab4b649bb66bde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5bcb32f161c79f03ba4bcc6e0968c201ff2d2626a5d33bd858b9f2743e36828f12c2a1823d8cdc2d6d4e6372444e3089b870b7705d1bd471fd501f7299257ea
|
7
|
+
data.tar.gz: 39b8f98f11603c418dd15ea740defe4aee550ce0c644b7f8f6c3b6c01e28fd3cfd3acfd85db86c423c4fda13da0250b5b75e8f33b6662c6bb96a03ab525a0fda
|
data/lib/photofy/core.rb
CHANGED
@@ -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
|
157
|
-
file_upload_parts =
|
158
|
-
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.
|
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.
|
49
|
+
rubygems_version: 2.6.14
|
50
50
|
signing_key:
|
51
51
|
specification_version: 4
|
52
52
|
summary: Photofy
|