bug in ImageScience when it processes .gifs
palidanx opened this issue · 1 comments
In ImageScience, gif thumbnails are saved in png
In
http://github.com/technoweenie/attachment_fu/blob/master/lib/technoweenie/attachment_fu.rb
There is a bug in line
# Gets the thumbnail name for a filename. 'foo.jpg' becomes 'foo_thumbnail.jpg'
def thumbnail_name_for(thumbnail = nil)
return filename if thumbnail.blank?
ext = nil
basename = filename.gsub /.\w+$/ do |s|
ext = s; ''
end
# ImageScience doesn't create gif thumbnails, only pngs
ext.sub!(/gif$/, 'png') if attachment_options[:processor] == "ImageScience"
"#{basename}_#{thumbnail}#{ext}"
end
attachment_options[:processor]
returns a symbol and the comparison fails
it works if you do...
ext.sub!(/gif$/, 'png') if attachment_options[:processor].to_s == "ImageScience"
Further correction. in attachment.rb if you specify it as a symbol you get this problem only
:processor => :ImageScience,