config: remove enable_image_cropping option.

There's no need to disable this option. Supporting it adds complexity
and disabling it is untested.
This commit is contained in:
evazion
2020-05-17 15:01:59 -05:00
parent 0a12f35c47
commit 24c53172db
6 changed files with 3 additions and 11 deletions

View File

@@ -27,8 +27,6 @@ module DanbooruImageResizer
end
def crop(file, width, height, resize_quality = 90)
return nil unless Danbooru.config.enable_image_cropping
output_file = Tempfile.new
resized_image = Vips::Image.thumbnail(file.path, width, height: height, **CROP_OPTIONS)
resized_image.jpegsave(output_file.path, Q: resize_quality, **JPEG_OPTIONS)

View File

@@ -69,8 +69,6 @@ class PixivUgoiraConverter
end
def self.generate_crop(ugoira_file)
return nil unless Danbooru.config.enable_image_cropping
file = Tempfile.new(["ugoira-crop", ".zip"], binmode: true)
zipfile = Zip::File.new(ugoira_file.path)
zipfile.entries.first.extract(file.path) { true } # 'true' means overwrite the existing tempfile.

View File

@@ -43,7 +43,7 @@ class PostPresenter
locals[:tooltip] = "#{post.tag_string} rating:#{post.rating} score:#{post.score}"
locals[:cropped_url] = if Danbooru.config.enable_image_cropping && options[:show_cropped] && post.has_cropped? && !CurrentUser.user.disable_cropped_thumbnails?
locals[:cropped_url] = if options[:show_cropped] && post.has_cropped? && !CurrentUser.user.disable_cropped_thumbnails?
post.crop_file_url
else
post.preview_file_url

View File

@@ -1,4 +1,4 @@
<div id="posts" class="user-disable-cropped-<%= Danbooru.config.enable_image_cropping && CurrentUser.user.disable_cropped_thumbnails? %>">
<div id="posts" class="user-disable-cropped-<%= CurrentUser.user.disable_cropped_thumbnails? %>">
<div id="posts-container">
<%= post_set.post_previews_html(self) %>
</div>

View File

@@ -1,4 +1,4 @@
<section class="recommended-posts user-disable-cropped-<%= Danbooru.config.enable_image_cropping && CurrentUser.user.disable_cropped_thumbnails? %>">
<section class="recommended-posts user-disable-cropped-<%= CurrentUser.user.disable_cropped_thumbnails? %>">
<% if @recs.empty? %>
No recommendations found.
<% end %>

View File

@@ -502,10 +502,6 @@ module Danbooru
def recaptcha_secret_key
end
def enable_image_cropping
true
end
# Akismet API key. Used for Dmail spam detection. http://akismet.com/signup/
def rakismet_key
end