Sha256: 7bb27d73b846d36107015d7c87000ab4704cec5733499cbca2bc205da1b49d63

Contents?: true

Size: 671 Bytes

Versions: 656

Compression:

Stored size: 671 Bytes

Contents

require_relative 'module'

module Snapshot
  # This class takes care of removing the alpha channel of the generated screenshots
  class ScreenshotFlatten
    # @param (String) The path in which the screenshots are located in
    def run(path)
      UI.message("Removing the alpha channel from generated png files")
      flatten(path)
    end

    def flatten(path)
      Dir.glob([path, '/**/*.png'].join('/')).each do |file|
        UI.verbose("Removing alpha channel from '#{file}'")
        `sips -s format bmp '#{file}' &> /dev/null` # &> /dev/null because there is warning because of the extension
        `sips -s format png '#{file}'`
      end
    end
  end
end

Version data entries

656 entries across 656 versions & 5 rubygems

Version Path
fastlane-2.81.0.beta.20180204010002 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.81.0.beta.20180203010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.81.0.beta.20180202010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.80.0 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.80.0.beta.20180201010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.80.0.beta.20180131010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.80.0.beta.20180130010002 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.79.0 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.79.0.beta.20180129010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.79.0.beta.20180128010002 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.79.0.beta.20180127010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.79.0.beta.20180126010002 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.79.0.beta.20180125010002 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.79.0.beta.20180124010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.79.0.beta.20180123010002 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.78.0 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.78.0.beta.20180122010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.78.0.beta.20180121010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.78.0.beta.20180120010003 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.78.0.beta.20180119010003 snapshot/lib/snapshot/screenshot_flatten.rb