2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-03-04 01:15:08 +08:00
discourse/app/models/image_quality_setting.rb
Ted Johansson e932298486
FEATURE: Add new, unified image_quality site setting (#35467)
We recently hid multiple very technical site settings related to image quality. In this PR we add a unified image_quality setting.

Power users can still configure the individual settings (now defaulting to 0) and they will take precedence.
2025-10-29 13:17:28 +08:00

20 lines
393 B
Ruby

# frozen_string_literal: true
class ImageQualitySetting < EnumSiteSetting
def self.valid_value?(val)
values.any? { |v| v[:value].to_s == val.to_s }
end
def self.values
[
{ name: "original", value: 100 },
{ name: "high", value: 90 },
{ name: "medium", value: 70 },
{ name: "low", value: 50 },
]
end
def self.translate_names?
false
end
end