allow anamorphic videos and automatically tag them

This commit is contained in:
edshot99 2025-01-18 15:14:30 -06:00
parent 744d6e6d11
commit 2620d18a5b
3 changed files with 11 additions and 1 deletions

View File

@ -121,4 +121,13 @@ module FileMethods
rescue
true
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

View File

@ -17,7 +17,7 @@ class FileValidator
validate_container_format(video)
validate_duration(video)
validate_colorspace(video)
validate_sar(video)
# validate_sar(video)
end
validate_resolution(max_width, max_height)
end

View File

@ -75,6 +75,7 @@ class UploadService
tags += ["animated_png", "animated"] if upload.is_animated_png?(file.path)
# tags += ["animated"] if upload.is_webm?
tags += ["ai_generated"] if upload.is_ai_generated?(file.path)
tags += ["anamorphic"] if upload.is_anamorphic?(file.path)
tags.join(" ")
end