Skip to content

Commit

Permalink
fix spec and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Mar 13, 2013
1 parent 516cce8 commit 823d111
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/webp/webp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ def webp_size(data)

# encode
def encode(input_file, output_file, options = {})
unless 0 == (res = C.webp_encode(input_file, output_file, init_options_object(options).encode_pointer))
raise EncoderError, ENCODER_ERRORS[res - 1]
unless 0 == (encode_res = C.webp_encode(input_file, output_file, init_options_object(options).encode_pointer))
raise EncoderError, ENCODER_ERRORS[encode_res - 1]
end
return true
true
end

# decode
def decode(input_file, output_file, options = {})
unless 0 == (res = C.webp_decode(input_file, output_file, init_options_object(options).decode_pointer))
raise DecoderError, DECODER_ERRORS[res - 1]
unless 0 == (decode_res = C.webp_decode(input_file, output_file, init_options_object(options).decode_pointer))
raise DecoderError, DECODER_ERRORS[decode_res - 1]
end
return true
true
end

private
Expand Down

0 comments on commit 823d111

Please sign in to comment.