From 4d1ab7a2261e72be2a745faa9264f74df261c961 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 23 Oct 2015 14:50:07 +0800 Subject: [PATCH] added new thumb size --- app/controllers/galleries_controller.rb | 2 ++ app/models/album_image.rb | 1 + app/uploaders/gallery_uploader.rb | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb index 8ff9967..0951ef9 100644 --- a/app/controllers/galleries_controller.rb +++ b/app/controllers/galleries_controller.rb @@ -67,6 +67,7 @@ class GalleriesController < ApplicationController "link_to_show" => OrbitHelper.widget_more_url + "/" + a.album.to_param + "#" + a.id.to_s, "alt_title" => alt_text, "thumb-src" => a.file.thumb.url, + "thumb-large-src" => a.file.thumb_large.url, "mobile-src" => a.file.mobile.url, "theater-src" => a.file.theater.url } @@ -109,4 +110,5 @@ class GalleriesController < ApplicationController render :json => {"data" => data}.to_json end + end \ No newline at end of file diff --git a/app/models/album_image.rb b/app/models/album_image.rb index b038b8b..d40ac10 100644 --- a/app/models/album_image.rb +++ b/app/models/album_image.rb @@ -1,3 +1,4 @@ +require 'net/http' class AlbumImage include Mongoid::Document include Mongoid::Timestamps diff --git a/app/uploaders/gallery_uploader.rb b/app/uploaders/gallery_uploader.rb index 0fa4968..e76a56d 100644 --- a/app/uploaders/gallery_uploader.rb +++ b/app/uploaders/gallery_uploader.rb @@ -59,6 +59,11 @@ class GalleryUploader < CarrierWave::Uploader::Base process :resize_to_fill => [200, 200] end + version :thumb_large do + process :fix_exif_rotation + process :resize_to_fill => [600, 600] + end + version :theater do process :fix_exif_rotation process :resize_to_limit => [1920, 1080]