Created
October 31, 2008 19:36
-
-
Save djanowski/21404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def image_tag(source, options = {}) | |
if options.is_a?(Hash) && source !~ /^http/ | |
size = `identify public/images/#{source}`[/ (\d+x\d+) /, 1] | |
if options[:size] | |
if options[:size] != size | |
line = "*** WRONG SIZE SPECIFIED FOR #{source}: :size => #{size.inspect} ***" | |
end | |
else | |
line = "*** SIZE NOT SPECIFIED FOR #{source}: :size => #{size.inspect} ***" | |
end | |
logger.warn(<<-EOS) unless line.blank? | |
#{'*' * line.size} | |
#{line} | |
#{'*' * line.size} | |
EOS | |
end | |
super | |
end if Rails.env == 'development' || Rails.env == 'test' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment