Sha256: e193950d99eaca1d463af9ef9a9f1b264fbac4b0b87a8757b2a3c3bf74b515ac

Contents?: true

Size: 691 Bytes

Versions: 3

Compression:

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

3 entries across 3 versions & 1 rubygems

Version Path
fastlane_hotfix-2.165.1 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane_hotfix-2.165.0 snapshot/lib/snapshot/screenshot_flatten.rb
fastlane_hotfix-2.187.0 snapshot/lib/snapshot/screenshot_flatten.rb