Permalink
Browse files

Enforce colorspace for resizing.

Especially when the source is CMYK or some other colorspace.

Fixes issue #232.
  • Loading branch information...
1 parent 558aaf4 commit aadde9de8e2e456d05f20e432ecb468feaab3b77 @nanaya committed Jan 23, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/moebooru/resizer.rb
View
@@ -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

0 comments on commit aadde9d

Please sign in to comment.