Class: RemoveBg::CompositeResult
- Defined in:
- lib/remove_bg/composite_result.rb
Overview
Handles image composition for larger images (over 10MP) where transparency is required.
Instance Attribute Summary
Attributes inherited from Result
Instance Method Summary collapse
-
#save_zip(file_path, overwrite: false) ⇒ nil
Saves the ZIP archive containing the alpha.png and color.jpg files (useful if you want to handle composition yourself).
Methods inherited from Result
Constructor Details
This class inherits a constructor from RemoveBg::Result
Instance Method Details
#save_zip(file_path, overwrite: false) ⇒ nil
Saves the ZIP archive containing the alpha.png and color.jpg files (useful if you want to handle composition yourself)
15 16 17 18 19 20 21 |
# File 'lib/remove_bg/composite_result.rb', line 15 def save_zip(file_path, overwrite: false) if File.exist?(file_path) && !overwrite raise FileOverwriteError.new(file_path) end FileUtils.cp(download, file_path) end |