Sha256: 7bb27d73b846d36107015d7c87000ab4704cec5733499cbca2bc205da1b49d63

Contents?: true

Size: 671 Bytes

Versions: 657

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

657 entries across 657 versions & 5 rubygems

Version Path
fastlane-2.117.0.beta.20190215200101 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.117.0.beta.20190214200107 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.117.0.beta.20190213200055 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.117.0.beta.20190212200112 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.117.0.beta.20190211200054 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.117.0.beta.20190210200028 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.117.0.beta.20190209200055 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.117.0.beta.20190208200116 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.117.0.beta.20190207200055 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190206200014 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190205200046 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190204200009 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190203200034 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190202200022 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190201200019 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190131200016 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190130200045 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190129200025 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.116.0.beta.20190128200102 snapshot/lib/snapshot/screenshot_flatten.rb