Skip to content

Commit

Permalink
refs #860, fixes images to be not animated
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Jurke committed Nov 26, 2014
1 parent daf01b4 commit 5890d8b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
18 changes: 13 additions & 5 deletions app/models/images/article_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ class ArticleImage < Image
extend STI
PROCESSING_IMAGE_URL = "pending.png"

has_attached_file :image, styles: { original: "900>x600>", medium: "520>x360>", thumb: "280x200>"},
convert_options: { medium: "-quality 75 -strip", thumb: "-quality 75 -strip -background white -gravity center -extent 260x180" },
default_url: "missing.png",
url: "/system/images/:id_partition/:style/:filename",
path: "public/system/images/:id_partition/:style/:filename"
has_attached_file :image,
styles: {
original: {geometry: "900>x600>", animated: false},
medium: {geometry: "520>x360>", animated: false},
thumb: {geometry: "280x200>", animated: false}
},
convert_options: {
medium: "-quality 75 -strip",
thumb: "-quality 75 -strip -background white -gravity center -extent 260x180"
},
default_url: "missing.png",
url: "/system/images/:id_partition/:style/:filename",
path: "public/system/images/:id_partition/:style/:filename"

process_in_background :image, :processing_image_url => PROCESSING_IMAGE_URL

Expand Down
12 changes: 8 additions & 4 deletions app/models/images/feedback_image.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
class FeedbackImage < Image
extend STI

has_attached_file :image, styles: { original: "300>x300>" },
default_url: "/assets/missing.png",
url: "/system/images/:id_partition/:style/:filename",
path: "public/system/images/:id_partition/:style/:filename"
has_attached_file :image,
styles: {
original: {geometry: "300>x300>", animated: false}
},
default_url: "/assets/missing.png",
url: "/system/images/:id_partition/:style/:filename",
path: "public/system/images/:id_partition/:style/:filename"

belongs_to :feedback, foreign_key: "imageable_id"

validates_attachment_presence :image, unless: :external_url
Expand Down
17 changes: 11 additions & 6 deletions app/models/images/user_image.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
class UserImage < Image
extend STI
has_attached_file :image, styles: { original: "300>x300>", profile: "300x300>" },
convert_options: { profile: "-quality 75 -strip -background white -gravity center -extent 300x300" },
default_url: "/assets/missing.png",
url: "/system/images/:id_partition/:style/:filename",
path: "public/system/images/:id_partition/:style/:filename",
only_process: [:profile]
has_attached_file :image,
styles: {
original: {geometry: "300>x300>", animated: false},
profile: {geometry: "300x300>", animated: false}
},
convert_options: { profile: "-quality 75 -strip -background white -gravity center -extent 300x300" },
default_url: "/assets/missing.png",
url: "/system/images/:id_partition/:style/:filename",
path: "public/system/images/:id_partition/:style/:filename",
only_process: [:profile]

belongs_to :user, foreign_key: "imageable_id"

validates_attachment_presence :image, :unless => :external_url
Expand Down

0 comments on commit 5890d8b

Please sign in to comment.