Skip to content

Commit

Permalink
Revert "Fix preview bug"
Browse files Browse the repository at this point in the history
This reverts commit 9213e16.
  • Loading branch information
eins78 committed Feb 19, 2015
1 parent 46def14 commit 860a6b4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion app/models/media_file_modules/previews.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def create_jpeg_previews_for_file file
cmd= %Q<convert "#{file}"[0] -auto-orient -thumbnail "#{value}" -flatten -unsharp 0x.5 "#{outfile}">
Rails.logger.info "CREATING THUMBNAIL `#{cmd}`"
`#{cmd}`
if File.exists?(outfile)
if File.exists?(outfile) && (File.size(file) > File.size(outfile))
x,y = `identify -format "%wx%h" "#{outfile}"`.split('x')
if x and y
previews.create(:content_type => 'image/jpeg', :filename => outfile.split('/').last, :height => y, :width => x, :thumbnail => thumb_size.to_s )
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2231,8 +2231,6 @@ INSERT INTO schema_migrations (version) VALUES ('20141014090348');

INSERT INTO schema_migrations (version) VALUES ('20150127134935');

INSERT INTO schema_migrations (version) VALUES ('20150217141205');

INSERT INTO schema_migrations (version) VALUES ('21');

INSERT INTO schema_migrations (version) VALUES ('22');
Expand Down

0 comments on commit 860a6b4

Please sign in to comment.