Sha256: c612b8b9d70d75470dcbb1e26cb3ee3bd097fe52364c8b96c6ec7a59c7765a0f

Contents?: true

Size: 670 Bytes

Versions: 4

Compression:

Stored size: 670 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

4 entries across 4 versions & 1 rubygems

Version Path
fastlane-2.74.1 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.74.0 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.74.0.beta.20180108010004 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane-2.74.0.beta.20180107010004 snapshot/lib/snapshot/screenshot_flatten.rb