lib/frameit/editor.rb in frameit-0.1.5 vs lib/frameit/editor.rb in frameit-0.2.0
- old
+ new
@@ -27,10 +27,12 @@
def run(path, color = Color::BLACK)
@color = color
Dir.glob("#{path}/**/*.{png,PNG}").each do |screenshot|
next if screenshot.include?"_framed.png"
+ next if screenshot.include?".itmsp/" # a package file, we don't want to modify that
+
begin
template_path = get_template(screenshot)
if template_path
template = MiniMagick::Image.open(template_path)
image = MiniMagick::Image.open(screenshot)
@@ -45,14 +47,12 @@
c.geometry offset_information[:offset]
end
output_path = screenshot.gsub('.png', '_framed.png').gsub('.PNG', '_framed.png')
result.write output_path
- Helper.log.info "Successfully framed screenshot at path '#{output_path}'".green
+ Helper.log.info "Added frame: '#{File.expand_path(output_path)}'".green
end
- rescue SystemExit, Interrupt => ex
- raise ex # system interrupted exception (ctrl + C)
- rescue Exception => ex
+ rescue => ex
Helper.log.error ex
end
end
end
\ No newline at end of file