Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Enforce colorspace for resizing.

Especially when the source is CMYK or some other colorspace.

Fixes issue #232.
  • Loading branch information...
commit aadde9de8e2e456d05f20e432ecb468feaab3b77 1 parent 558aaf4
@edogawaconan authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/moebooru/resizer.rb
View
4 lib/moebooru/resizer.rb
@@ -32,6 +32,10 @@ def resize(file_ext, read_path, write_path, output_size, output_quality)
if write_format =~ /\Ajpe?g\z/
f.sampling_factor '2x2,1x1,1x1'
end
+ # Any other colorspaces suck for storing images.
+ # Since we're just resizing stuff here, actual colorspace shouldn't
+ # matter much.
+ f.colorspace 'RGB'
f.quality output_quality.to_s
end
image.write write_path
Please sign in to comment.
Something went wrong with that request. Please try again.