Skip to content

Commit

Permalink
Merge pull request #196 from sharetribe/Location_data_removal_for_lis…
Browse files Browse the repository at this point in the history
…ting_pictures

Location data (EXIF) removal for listing pictures
  • Loading branch information
thomasmalbaux committed Oct 19, 2022
2 parents 9846ca9 + 52299b4 commit ef55cf1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
20 changes: 11 additions & 9 deletions app/models/listing_image.rb
Expand Up @@ -35,15 +35,17 @@ class ListingImage < ApplicationRecord

# see paperclip (for image_processing column)
has_attached_file :image,
:styles => {
:small_3x2 => "240x160#",
:medium => "360x270#",
:thumb => "120x120#",
:original => "#{APP_CONFIG.original_image_width}x#{APP_CONFIG.original_image_height}>",
:big => Proc.new { |instance| instance.crop_big },
:email => "150x100#",
:square => "408x408#",
:square_2x => "816x816#"}
styles: {
small_3x2: "240x160#",
medium: "360x270#",
thumb: "120x120#",
original: "#{APP_CONFIG.original_image_width}x#{APP_CONFIG.original_image_height}>",
big: Proc.new { |instance| instance.crop_big },
email: "150x100#",
square: "408x408#",
square_2x: "816x816#"
},
convert_options: { all: "-strip" }

before_image_post_process :set_dimensions

Expand Down
13 changes: 8 additions & 5 deletions app/models/person.rb
Expand Up @@ -218,11 +218,14 @@ def to_param
length: {within: 3..20},
format: {with: /\A[A-Z0-9_]*\z/i, message: :username_is_invalid}

has_attached_file :image, :styles => {
:medium => "288x288#",
:small => "108x108#",
:thumb => "48x48#",
:original => "600x800>"}
has_attached_file :image,
styles: {
medium: "288x288#",
small: "108x108#",
thumb: "48x48#",
original: "600x800>"
},
convert_options: { all: "-strip" }

process_in_background :image, priority: 1

Expand Down

0 comments on commit ef55cf1

Please sign in to comment.