forked from e621ng/e621ng
allow anamorphic videos and automatically tag them
This commit is contained in:
parent
744d6e6d11
commit
2620d18a5b
@ -121,4 +121,13 @@ module FileMethods
|
|||||||
rescue
|
rescue
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_anamorphic?(file_path)
|
||||||
|
return false if is_image?
|
||||||
|
|
||||||
|
video = FFMPEG::Movie.new(file_path)
|
||||||
|
return false if video.sar == "1:1"
|
||||||
|
|
||||||
|
true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -17,7 +17,7 @@ class FileValidator
|
|||||||
validate_container_format(video)
|
validate_container_format(video)
|
||||||
validate_duration(video)
|
validate_duration(video)
|
||||||
validate_colorspace(video)
|
validate_colorspace(video)
|
||||||
validate_sar(video)
|
# validate_sar(video)
|
||||||
end
|
end
|
||||||
validate_resolution(max_width, max_height)
|
validate_resolution(max_width, max_height)
|
||||||
end
|
end
|
||||||
|
@ -75,6 +75,7 @@ class UploadService
|
|||||||
tags += ["animated_png", "animated"] if upload.is_animated_png?(file.path)
|
tags += ["animated_png", "animated"] if upload.is_animated_png?(file.path)
|
||||||
# tags += ["animated"] if upload.is_webm?
|
# tags += ["animated"] if upload.is_webm?
|
||||||
tags += ["ai_generated"] if upload.is_ai_generated?(file.path)
|
tags += ["ai_generated"] if upload.is_ai_generated?(file.path)
|
||||||
|
tags += ["anamorphic"] if upload.is_anamorphic?(file.path)
|
||||||
tags.join(" ")
|
tags.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user