diff --git a/app/logical/danbooru_image_resizer.rb b/app/logical/danbooru_image_resizer.rb index b4b7230e3..b3eb926ac 100644 --- a/app/logical/danbooru_image_resizer.rb +++ b/app/logical/danbooru_image_resizer.rb @@ -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 diff --git a/config/sRGB.icm b/config/sRGB.icm deleted file mode 100644 index 59b450704..000000000 Binary files a/config/sRGB.icm and /dev/null differ