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:
@@ -27,8 +27,6 @@ module DanbooruImageResizer
|
|||||||
end
|
end
|
||||||
|
|
||||||
def crop(file, width, height, resize_quality = 90)
|
def crop(file, width, height, resize_quality = 90)
|
||||||
return nil unless Danbooru.config.enable_image_cropping
|
|
||||||
|
|
||||||
output_file = Tempfile.new
|
output_file = Tempfile.new
|
||||||
resized_image = Vips::Image.thumbnail(file.path, width, height: height, **CROP_OPTIONS)
|
resized_image = Vips::Image.thumbnail(file.path, width, height: height, **CROP_OPTIONS)
|
||||||
resized_image.jpegsave(output_file.path, Q: resize_quality, **JPEG_OPTIONS)
|
resized_image.jpegsave(output_file.path, Q: resize_quality, **JPEG_OPTIONS)
|
||||||
|
|||||||
@@ -69,8 +69,6 @@ class PixivUgoiraConverter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.generate_crop(ugoira_file)
|
def self.generate_crop(ugoira_file)
|
||||||
return nil unless Danbooru.config.enable_image_cropping
|
|
||||||
|
|
||||||
file = Tempfile.new(["ugoira-crop", ".zip"], binmode: true)
|
file = Tempfile.new(["ugoira-crop", ".zip"], binmode: true)
|
||||||
zipfile = Zip::File.new(ugoira_file.path)
|
zipfile = Zip::File.new(ugoira_file.path)
|
||||||
zipfile.entries.first.extract(file.path) { true } # 'true' means overwrite the existing tempfile.
|
zipfile.entries.first.extract(file.path) { true } # 'true' means overwrite the existing tempfile.
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class PostPresenter
|
|||||||
|
|
||||||
locals[:tooltip] = "#{post.tag_string} rating:#{post.rating} score:#{post.score}"
|
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
|
post.crop_file_url
|
||||||
else
|
else
|
||||||
post.preview_file_url
|
post.preview_file_url
|
||||||
|
|||||||
@@ -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">
|
<div id="posts-container">
|
||||||
<%= post_set.post_previews_html(self) %>
|
<%= post_set.post_previews_html(self) %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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? %>
|
<% if @recs.empty? %>
|
||||||
No recommendations found.
|
No recommendations found.
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -502,10 +502,6 @@ module Danbooru
|
|||||||
def recaptcha_secret_key
|
def recaptcha_secret_key
|
||||||
end
|
end
|
||||||
|
|
||||||
def enable_image_cropping
|
|
||||||
true
|
|
||||||
end
|
|
||||||
|
|
||||||
# Akismet API key. Used for Dmail spam detection. http://akismet.com/signup/
|
# Akismet API key. Used for Dmail spam detection. http://akismet.com/signup/
|
||||||
def rakismet_key
|
def rakismet_key
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user