Merge remote-tracking branch 'parent/main' into upstream-20240731
This commit is contained in:
commit
8b09a57a91
320 changed files with 3132 additions and 1643 deletions
|
@ -85,7 +85,14 @@ class Admin::Metrics::Dimension::SoftwareVersionsDimension < Admin::Metrics::Dim
|
|||
def imagemagick_version
|
||||
return if Rails.configuration.x.use_vips
|
||||
|
||||
version = `convert -version`.match(/Version: ImageMagick ([\d\.]+)/)[1]
|
||||
imagemagick_binary = Paperclip.options[:is_windows] ? 'magick convert' : 'convert'
|
||||
|
||||
version_output = Terrapin::CommandLine.new(imagemagick_binary, '-version').run
|
||||
version_match = version_output.match(/Version: ImageMagick (\S+)/)[1].strip
|
||||
|
||||
return nil unless version_match
|
||||
|
||||
version = version_match
|
||||
|
||||
{
|
||||
key: 'imagemagick',
|
||||
|
@ -93,12 +100,13 @@ class Admin::Metrics::Dimension::SoftwareVersionsDimension < Admin::Metrics::Dim
|
|||
value: version,
|
||||
human_value: version,
|
||||
}
|
||||
rescue Errno::ENOENT
|
||||
rescue Terrapin::CommandNotFoundError, Terrapin::ExitStatusError, Paperclip::Errors::CommandNotFoundError, Paperclip::Errors::CommandFailedError
|
||||
nil
|
||||
end
|
||||
|
||||
def ffmpeg_version
|
||||
version = `ffmpeg -version`.match(/ffmpeg version ([\d\.]+)/)[1]
|
||||
version_output = Terrapin::CommandLine.new(Rails.configuration.x.ffprobe_binary, '-show_program_version -v 0 -of json').run
|
||||
version = Oj.load(version_output, mode: :strict, symbol_keys: true).dig(:program_version, :version)
|
||||
|
||||
{
|
||||
key: 'ffmpeg',
|
||||
|
@ -106,7 +114,7 @@ class Admin::Metrics::Dimension::SoftwareVersionsDimension < Admin::Metrics::Dim
|
|||
value: version,
|
||||
human_value: version,
|
||||
}
|
||||
rescue Errno::ENOENT
|
||||
rescue Terrapin::CommandNotFoundError, Terrapin::ExitStatusError, Oj::ParseError
|
||||
nil
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue