update readme. using sqlite3 as default for dev. minimagick as default processor. reanabled exif read/write
This commit is contained in:
parent
7f8074a5bf
commit
58572966aa
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
.bundle
|
||||
.rvmrc
|
||||
db/*.sqlite3
|
||||
log/*.log
|
||||
tmp
|
||||
|
|
6
Gemfile
6
Gemfile
|
@ -9,16 +9,18 @@ gem "carrierwave", :git => 'git://github.com/jnicklas/carrierwave.git'
|
|||
#gem "mysql2"
|
||||
# PostgreSQL:
|
||||
gem 'pg'
|
||||
# SQLite
|
||||
gem 'sqlite3-ruby'
|
||||
|
||||
# S3 support
|
||||
gem 'fog'
|
||||
|
||||
# ImageMagick:
|
||||
gem "rmagick", :require => 'RMagick'
|
||||
#gem "rmagick", :require => 'RMagick'
|
||||
|
||||
# FreeImage:
|
||||
#gem "RubyInline"
|
||||
#gem "image_science", :git => 'git://github.com/perezd/image_science.git'
|
||||
|
||||
# MiniMagick
|
||||
#gem "mini_magick"
|
||||
gem "mini_magick"
|
10
Gemfile.lock
10
Gemfile.lock
|
@ -60,6 +60,8 @@ GEM
|
|||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
mime-types (1.16)
|
||||
mini_magick (3.2)
|
||||
subexec (~> 0.0.4)
|
||||
net-ssh (2.0.23)
|
||||
nokogiri (1.4.4)
|
||||
pg (0.10.0)
|
||||
|
@ -83,8 +85,11 @@ GEM
|
|||
rake (>= 0.8.7)
|
||||
thor (~> 0.14.4)
|
||||
rake (0.8.7)
|
||||
rmagick (2.13.1)
|
||||
ruby-hmac (0.4.0)
|
||||
sqlite3 (1.3.3)
|
||||
sqlite3-ruby (1.3.3)
|
||||
sqlite3 (>= 1.3.3)
|
||||
subexec (0.0.4)
|
||||
thor (0.14.6)
|
||||
treetop (1.4.9)
|
||||
polyglot (>= 0.3.1)
|
||||
|
@ -98,6 +103,7 @@ DEPENDENCIES
|
|||
carrierwave!
|
||||
fog
|
||||
mime-types
|
||||
mini_magick
|
||||
pg
|
||||
rails (= 3.0.3)
|
||||
rmagick
|
||||
sqlite3-ruby
|
||||
|
|
20
README
20
README
|
@ -31,7 +31,7 @@ Free for personal use. Contact me for commercial license.
|
|||
Rails 3.0
|
||||
|
||||
Software
|
||||
- RMagicK (required for Carrierwave resizing). Can also use ImageScience
|
||||
- ImageMagicK (required for Carrierwave resizing). Can also use ImageScience
|
||||
Optional:
|
||||
- ExifTool (required for Mini_EfixTool)
|
||||
|
||||
|
@ -47,15 +47,15 @@ Optional:
|
|||
|
||||
1. Clone the project from GitHub or Gitorious:
|
||||
GitHub: git clone git://github.com/espen/balder.git
|
||||
Gitorious: git clone git://gitorious.org/gallery-without-a-name/gallery-without-a-name.git
|
||||
2. install required software listed above
|
||||
3. Copy settings file:
|
||||
cp gallery/config/database.example.yml gallery/config/database.yml
|
||||
cp gallery/config/settings.example.yml gallery/config/settings.yml
|
||||
4. Create databsae user and edit settings files.
|
||||
5. rake db:create
|
||||
6. rake db:migrate
|
||||
7. Start up the project with your preferred web-server
|
||||
2. Install required software listed above
|
||||
3. 'bundle install' to install required gems.
|
||||
4. Adjust the settings in balder.rb
|
||||
5. Copy database file (not needed when hosting on Heroku):
|
||||
cp config/database.example.yml config/database.yml
|
||||
6. Create database user and edit database file. (unless on Heroku or using SQLite3)
|
||||
7. rake db:create
|
||||
8. rake db:migrate
|
||||
9. Start up the project with your preferred web-server
|
||||
|
||||
=== Optional: add photos directly to disk
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def check_public_access
|
||||
require_user if ENV['PUBLIC'] == 'false'
|
||||
require_user if ENV['PRIVATE'] == 'true'
|
||||
end
|
||||
|
||||
def current_user_session
|
||||
|
|
|
@ -10,8 +10,8 @@ class Photo < ActiveRecord::Base
|
|||
validates :title, :presence => true
|
||||
|
||||
before_validation :set_title
|
||||
#before_create :exif_read
|
||||
#before_update :exif_write # should only write if tags are changed as images can be large and thus ExifTool will take a while to write to the file
|
||||
before_create :exif_read
|
||||
before_update :exif_write
|
||||
|
||||
attr_accessor :tag_list
|
||||
#attr_protected :path
|
||||
|
@ -79,6 +79,7 @@ class Photo < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def exif_write
|
||||
# should only write if tags are changed as images can be large and thus ExifTool will take a while to write to the file
|
||||
photo = MiniExiftool.new(self.path.file)
|
||||
photo.GPSLongitude = self.longitude
|
||||
photo.GPSLatitude = self.latitude
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
class FileUploader < CarrierWave::Uploader::Base
|
||||
|
||||
# Include RMagick or ImageScience support
|
||||
include CarrierWave::RMagick
|
||||
# include CarrierWave::RMagick
|
||||
# include CarrierWave::ImageScience
|
||||
# include CarrierWave::MiniMagick
|
||||
include CarrierWave::MiniMagick
|
||||
# Choose what kind of storage to use for this uploader
|
||||
if ENV['S3_KEY']
|
||||
storage :s3
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
if(swfobject.hasFlashPlayerVersion("9.0.0")) {
|
||||
$('#noFlash').hide()
|
||||
}
|
||||
$('#photo_file').uploadify({
|
||||
uploader:'<%= javascript_path "uploadify-2.1/uploadify.swf" -%>',
|
||||
script:'<%= photos_path %>',
|
||||
|
@ -30,6 +33,8 @@ $(document).ready(function() {
|
|||
})
|
||||
</script>
|
||||
<% end %>
|
||||
<div id="noFlash">I'm really sorry, you need Flash to upload files.</div>
|
||||
|
||||
<form>
|
||||
<input type="file" id="photo_file">
|
||||
<br>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
development:
|
||||
adapter: postgresql
|
||||
database: balder_development
|
||||
username: balder
|
||||
password: changeme
|
||||
adapter: sqlite3
|
||||
database: db/development.sqlite3
|
||||
pool: 5
|
||||
timeout: 5000
|
||||
production:
|
||||
adapter: mysql
|
||||
encoding: utf8
|
||||
|
|
Loading…
Reference in a new issue