forked from e621ng/e621ng
[Misc] Use libvips provided color profile
This commit is contained in:
parent
f5fcd8a53b
commit
1a7df4a497
@ -1,13 +1,11 @@
|
||||
module DanbooruImageResizer
|
||||
extend self
|
||||
module_function
|
||||
|
||||
# Taken from ArgyllCMS 2.0.0 (see also: https://ninedegreesbelow.com/photography/srgb-profile-comparison.html)
|
||||
SRGB_PROFILE = "#{Rails.root}/config/sRGB.icm"
|
||||
# https://www.libvips.org/API/current/libvips-resample.html#vips-thumbnail
|
||||
THUMBNAIL_OPTIONS = { size: :down, linear: false, no_rotate: true, export_profile: SRGB_PROFILE, import_profile: SRGB_PROFILE }
|
||||
THUMBNAIL_OPTIONS = { size: :down, linear: false, no_rotate: true, export_profile: "srgb", import_profile: "srgb" }.freeze
|
||||
# https://www.libvips.org/API/current/VipsForeignSave.html#vips-jpegsave
|
||||
JPEG_OPTIONS = { background: 0, strip: true, interlace: true, optimize_coding: true }
|
||||
CROP_OPTIONS = { linear: false, no_rotate: true, export_profile: SRGB_PROFILE, import_profile: SRGB_PROFILE, crop: :attention }
|
||||
JPEG_OPTIONS = { background: 0, strip: true, interlace: true, optimize_coding: true }.freeze
|
||||
CROP_OPTIONS = { linear: false, no_rotate: true, export_profile: "srgb", import_profile: "srgb", crop: :attention }.freeze
|
||||
|
||||
def resize(file, width, height, resize_quality = 90)
|
||||
output_file = Tempfile.new
|
||||
|
BIN
config/sRGB.icm
BIN
config/sRGB.icm
Binary file not shown.
Loading…
Reference in New Issue
Block a user