lib/usps_flags/helpers.rb in usps_flags-0.3.16 vs lib/usps_flags/helpers.rb in usps_flags-0.3.17
- old
+ new
@@ -25,11 +25,12 @@
# @param [String] png_file Path to the PNG file to resize.
# @param [String] file Abbreviated key for the output file (e.g. "LTC", "insignia/FLT").
# @param [String] outfile Path to the output file.
# @param [String] size Actual size to output as.
# @param [String] size_key Size suffix to attach to the file name.
- def resize_png(png_file, file: nil, outfile: nil, size:, size_key:)
+ def resize_png(png_file, file: nil, outfile: nil, size:, size_key: nil)
raise USPSFlags::Errors::PNGConversionError if outfile.nil? && file.nil?
+ raise USPSFlags::Errors::PNGConversionError if outfile.nil? && size_key.nil?
output_file_name = outfile || "#{USPSFlags.configuration.flags_dir}/PNG/#{file}.#{size_key}.png"
MiniMagick::Tool::Convert.new do |convert|
convert << "-background" << "none"
convert << "-format" << "png"
convert << "-resize" << "#{size}"