diff --git a/Gifski/AppDelegate.swift b/Gifski/AppDelegate.swift index 73ef6315..4e0401c6 100644 --- a/Gifski/AppDelegate.swift +++ b/Gifski/AppDelegate.swift @@ -32,7 +32,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate { NSApp.isAutomaticCustomizeTouchBarMenuItemEnabled = true NSApp.servicesProvider = self - // Set launch completions option if the notification center could not be set up already + // Set launch completions option if the notification center could not be set up already. LaunchCompletions.applicationDidLaunch() } diff --git a/Gifski/Constants.swift b/Gifski/Constants.swift index bbbe0558..3ebb1f8e 100644 --- a/Gifski/Constants.swift +++ b/Gifski/Constants.swift @@ -1,7 +1,7 @@ import Cocoa import Defaults -struct Constants { +enum Constants { static let defaultWindowSize = CGSize(width: 360, height: 240) static let backgroundImage = NSImage(named: "BackgroundImage")! static let allowedFrameRate = 5.0...50.0 diff --git a/Gifski/EditVideoViewController.swift b/Gifski/EditVideoViewController.swift index 0e806bfe..070cad0f 100644 --- a/Gifski/EditVideoViewController.swift +++ b/Gifski/EditVideoViewController.swift @@ -293,7 +293,8 @@ final class EditVideoViewController: NSViewController { NSAlert.showModal( for: view.window, message: "Animated GIF Limitation", - informativeText: "Exporting GIFs with a frame rate higher than 50 is not supported as browsers will throttle and play them at 10 FPS." + informativeText: "Exporting GIFs with a frame rate higher than 50 is not supported as browsers will throttle and play them at 10 FPS.", + defaultButtonIndex: -1 ) } } @@ -309,7 +310,8 @@ final class EditVideoViewController: NSViewController { NSAlert.showModal( for: view.window, message: "Animated GIF Preview Limitation", - informativeText: "Due to a bug in the macOS GIF animation handling, the after-conversion preview and Quick Look may not loop as expected. The GIF will work properly in web browsers and other image viewing apps." + informativeText: "Due to a bug in the macOS GIF handling, the after-conversion preview and Quick Look may not loop as expected. The GIF will loop correctly in web browsers and other image viewing apps.", + defaultButtonIndex: -1 ) } } @@ -481,7 +483,7 @@ final class EditVideoViewController: NSViewController { let gifski = Gifski() self.gifski = gifski - setEstimatedFileSize(getNaiveEstimate().attributedString + " Calculating Accurate Estimate…".attributedString.withColor(.secondaryLabelColor).withFontSize(NSFont.smallSystemFontSize.double)) + setEstimatedFileSize(getNaiveEstimate().attributedString + " Calculating Estimate…".attributedString.withColor(.secondaryLabelColor).withFontSize(NSFont.smallSystemFontSize.double)) gifski.run(conversionSettings, isEstimation: true) { [weak self] result in guard let self = self else { diff --git a/Gifski/MainWindowController.swift b/Gifski/MainWindowController.swift index 659885a8..5a899857 100644 --- a/Gifski/MainWindowController.swift +++ b/Gifski/MainWindowController.swift @@ -29,7 +29,7 @@ final class MainWindowController: NSWindowController { message: "Feedback Welcome 🙌🏻", informativeText: """ - If you have any feedback, bug reports, or feature requests, kindly use the “Send Feedback” button in the “Help” menu. We respond to all submissions. It's preferable that you report bugs this way rather than as an App Store review, since the App Store will not allow us to contact you for more information. + If you have any feedback, bug report, or feature request, there's a feedback button in the “Help” menu. We respond to all submissions. """, buttonTitles: [ "Get Started" diff --git a/Gifski/Shared.swift b/Gifski/Shared.swift index 5d7e83fb..f4b09f09 100644 --- a/Gifski/Shared.swift +++ b/Gifski/Shared.swift @@ -1,6 +1,6 @@ import Foundation -struct Shared { +enum Shared { static let appIdentifierPrefix = Bundle.main.infoDictionary!["AppIdentifierPrefix"] as! String static let videoShareGroupIdentifier = "\(appIdentifierPrefix)gifski_video_share_group" } diff --git a/Gifski/Utilities.swift b/Gifski/Utilities.swift index 28f04a2b..5899197c 100644 --- a/Gifski/Utilities.swift +++ b/Gifski/Utilities.swift @@ -719,6 +719,7 @@ enum AVFormat: String { case hevc case h264 case av1 + case vp9 case appleProResRAWHQ case appleProResRAW case appleProRes4444XQ @@ -751,6 +752,8 @@ enum AVFormat: String { self = .h264 case "av01": self = .av1 + case "vp09": + self = .vp9 case "aprh": // From https://avpres.net/Glossar/ProResRAW.html self = .appleProResRAWHQ case "aprn": @@ -802,6 +805,8 @@ enum AVFormat: String { return "avc1" case .av1: return "av01" + case .vp9: + return "vp09" case .appleProResRAWHQ: return "aprh" case .appleProResRAW: @@ -867,6 +872,8 @@ extension AVFormat: CustomStringConvertible { return "H264" case .av1: return "AV1" + case .vp9: + return "VP9" case .appleProResRAWHQ: return "Apple ProRes RAW HQ" case .appleProResRAW: @@ -3518,7 +3525,7 @@ extension NSFont { Self(descriptor: descriptor, size: 0) ?? self } - // TODO: When Xcode 12.2 is out, use `[NSFont fontWithSize:]` when available. + // TODO: Remove this when targeting macOS 10.15 as it's then built-in. /// Returns a font with the size replaced. /// UIKit polyfill. func withSize(_ size: CGFloat) -> NSFont { diff --git a/gifski-api/Cargo.lock b/gifski-api/Cargo.lock index 46b762f0..7942b62a 100644 --- a/gifski-api/Cargo.lock +++ b/gifski-api/Cargo.lock @@ -2,11 +2,11 @@ # It is not intended for manual editing. [[package]] name = "aho-corasick" -version = "0.7.10" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +checksum = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" dependencies = [ - "memchr", + "memchr 2.3.3", ] [[package]] @@ -15,7 +15,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi", + "winapi 0.3.8", ] [[package]] @@ -26,30 +26,26 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi", + "winapi 0.3.8", ] [[package]] name = "bindgen" -version = "0.55.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b13ce559e6433d360c26305643803cb52cfbabbc2b9c47ce04a58493dfb443" +checksum = "8b242e11a8f446f5fc7b76b37e81d737cabca562a927bd33766dac55b5f1177f" dependencies = [ - "bitflags 1.2.1", "cexpr", - "cfg-if 0.1.10", + "cfg-if", "clang-sys", "clap", "env_logger", "lazy_static", - "lazycell", - "log", + "log 0.3.9", "peeking_take_while", "proc-macro2", "quote", "regex", - "rustc-hash", - "shlex", "which", ] @@ -73,9 +69,9 @@ checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" [[package]] name = "cexpr" -version = "0.4.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" +checksum = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c" dependencies = [ "nom", ] @@ -86,19 +82,13 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "clang-sys" -version = "1.0.3" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0659001ab56b791be01d4b729c44376edc6718cf389a502e579b77b758f3296c" +checksum = "e414af9726e1d11660801e73ccc7fb81803fb5f49e5903a25b348b2b3b480d2e" dependencies = [ - "glob", + "glob 0.2.11", "libc", "libloading", ] @@ -126,21 +116,18 @@ checksum = "0dbbb57365263e881e805dc77d94697c9118fd94d8da011240555aa7b23445bd" [[package]] name = "env_logger" -version = "0.7.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +checksum = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" dependencies = [ - "atty", - "humantime", - "log", + "log 0.3.9", "regex", - "termcolor", ] [[package]] name = "ffmpeg" -version = "0.2.0" -source = "git+https://github.com/kornelski/rust-ffmpeg.git?rev=4da6d270cdaa868e5488144ed73bfaabe329cfcb#4da6d270cdaa868e5488144ed73bfaabe329cfcb" +version = "0.2.0-alpha.2" +source = "git+https://github.com/kornelski/rust-ffmpeg.git?rev=c84a77639ae4d60f22cad800cd503d2d6ae05fbe#c84a77639ae4d60f22cad800cd503d2d6ae05fbe" dependencies = [ "bitflags 0.9.1", "ffmpeg-sys", @@ -149,15 +136,16 @@ dependencies = [ [[package]] name = "ffmpeg-sys" -version = "4.2.1" -source = "git+https://github.com/meh/rust-ffmpeg-sys#70f711a43eb7ff7447fcffa98bb9f533acc08a1e" +version = "3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abbd18102427db5a9d4d1eb6d0a78a7f318515c64461e75e30f46b2aa72bf9dd" dependencies = [ "bindgen", "cc", "libc", "num_cpus", "pkg-config", - "vcpkg", + "regex", ] [[package]] @@ -211,6 +199,12 @@ dependencies = [ "wild", ] +[[package]] +name = "glob" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" + [[package]] name = "glob" version = "0.3.0" @@ -226,15 +220,6 @@ dependencies = [ "libc", ] -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] - [[package]] name = "imagequant" version = "2.12.5" @@ -263,16 +248,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aa18eb070bbea81d409ddebd55e2bcb8c2931ade125bad36d4fe8da115ca82b" [[package]] -name = "lazy_static" -version = "1.4.0" +name = "kernel32-sys" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] [[package]] -name = "lazycell" -version = "1.2.1" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" @@ -282,12 +271,13 @@ checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" [[package]] name = "libloading" -version = "0.6.5" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1090080fe06ec2648d0da3881d9453d97e71a45f00eb179af7fdd7e3f686fdb0" +checksum = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" dependencies = [ - "cfg-if 1.0.0", - "winapi", + "kernel32-sys", + "lazy_static", + "winapi 0.2.8", ] [[package]] @@ -300,13 +290,22 @@ dependencies = [ "rgb", ] +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +dependencies = [ + "log 0.4.8", +] + [[package]] name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", ] [[package]] @@ -315,6 +314,15 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" +[[package]] +name = "memchr" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" +dependencies = [ + "libc", +] + [[package]] name = "memchr" version = "2.3.3" @@ -329,12 +337,11 @@ checksum = "308d96db8debc727c3fd9744aac51751243420e46edf401010908da7f8d5e57c" [[package]] name = "nom" -version = "5.1.2" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +checksum = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" dependencies = [ - "memchr", - "version_check", + "memchr 1.0.2", ] [[package]] @@ -371,7 +378,7 @@ dependencies = [ "libc", "termion", "time", - "winapi", + "winapi 0.3.8", ] [[package]] @@ -388,9 +395,9 @@ checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" [[package]] name = "proc-macro2" -version = "1.0.10" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" +checksum = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" dependencies = [ "unicode-xid", ] @@ -403,9 +410,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" +checksum = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408" dependencies = [ "proc-macro2", ] @@ -427,21 +434,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.3.6" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6946991529684867e47d86474e3a6d0c0ab9b82d5821e314b1ede31fa3a4b3" +checksum = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" dependencies = [ "aho-corasick", - "memchr", + "memchr 2.3.3", "regex-syntax", "thread_local", + "utf8-ranges", ] [[package]] name = "regex-syntax" -version = "0.6.17" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" +checksum = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" +dependencies = [ + "ucd-util", +] [[package]] name = "resize" @@ -455,33 +466,12 @@ version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ec4ab2cf0b27e111e266e161cf7f9efd20125a161190da1c0945c4a4408fef3" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "shlex" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" - [[package]] name = "strsim" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -[[package]] -name = "termcolor" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" -dependencies = [ - "winapi-util", -] - [[package]] name = "termion" version = "1.5.5" @@ -505,9 +495,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.0.1" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" dependencies = [ "lazy_static", ] @@ -520,9 +510,15 @@ checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" dependencies = [ "libc", "redox_syscall", - "winapi", + "winapi 0.3.8", ] +[[package]] +name = "ucd-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85f514e095d348c279b1e5cd76795082cf15bd59b93207832abe0b1d8fed236" + [[package]] name = "unicode-width" version = "0.1.7" @@ -531,15 +527,15 @@ checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" [[package]] name = "unicode-xid" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] -name = "vcpkg" -version = "0.2.10" +name = "utf8-ranges" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" +checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" [[package]] name = "vec_map" @@ -547,17 +543,11 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -[[package]] -name = "version_check" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" - [[package]] name = "which" -version = "3.1.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" +checksum = "e84a603e7e0b1ce1aa1ee2b109c7be00155ce52df5081590d1ffb93f4f515cb2" dependencies = [ "libc", ] @@ -568,9 +558,15 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d34fecce28871e5c0e059deae21ef7f7d13b98a5964b24c58b3735c8052fc8" dependencies = [ - "glob", + "glob 0.3.0", ] +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + [[package]] name = "winapi" version = "0.3.8" @@ -582,19 +578,16 @@ dependencies = [ ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "winapi-build" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" [[package]] -name = "winapi-util" -version = "0.1.4" +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa515c5163a99cc82bab70fd3bfdd36d827be85de63737b40fcef2ce084a436e" -dependencies = [ - "winapi", -] +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-x86_64-pc-windows-gnu"