posts: remove cropped thumbnails.
This commit is contained in:
@@ -181,17 +181,6 @@ class MediaFile
|
||||
nil
|
||||
end
|
||||
|
||||
# Return a cropped preview version of the file, sized to fit exactly within
|
||||
# the given width and height.
|
||||
#
|
||||
# @param width [Integer] the width of the cropped image
|
||||
# @param height [Integer] the height of the cropped image
|
||||
# @param options [Hash] extra options when generating the preview
|
||||
# @return [MediaFile] a cropped preview file
|
||||
def crop(width, height, **options)
|
||||
nil
|
||||
end
|
||||
|
||||
def attributes
|
||||
{
|
||||
path: path,
|
||||
|
||||
@@ -92,10 +92,6 @@ class MediaFile::Image < MediaFile
|
||||
resize(w, h, size: :force, **options)
|
||||
end
|
||||
|
||||
def crop(max_width, max_height, **options)
|
||||
resize(max_width, max_height, crop: :attention, **options)
|
||||
end
|
||||
|
||||
def preview_frame
|
||||
if is_animated?
|
||||
FFmpeg.new(file).smart_video_preview
|
||||
|
||||
@@ -30,10 +30,6 @@ class MediaFile::Ugoira < MediaFile
|
||||
preview_frame.preview(width, height, **options)
|
||||
end
|
||||
|
||||
def crop(width, height)
|
||||
preview_frame.crop(width, height)
|
||||
end
|
||||
|
||||
def duration
|
||||
(frame_delays.sum / 1000.0)
|
||||
end
|
||||
|
||||
@@ -15,10 +15,6 @@ class MediaFile::Video < MediaFile
|
||||
preview_frame.preview(max_width, max_height, **options)
|
||||
end
|
||||
|
||||
def crop(max_width, max_height)
|
||||
preview_frame.crop(max_width, max_height)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def video
|
||||
|
||||
@@ -84,7 +84,6 @@ class UploadService
|
||||
|
||||
def convert_to_post(upload)
|
||||
Post.new.tap do |p|
|
||||
p.has_cropped = true
|
||||
p.tag_string = upload.tag_string
|
||||
p.md5 = upload.md5
|
||||
p.file_ext = upload.file_ext
|
||||
|
||||
Reference in New Issue
Block a user