Skip to content

Commit

Permalink
2.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
alin23 committed Jan 2, 2024
1 parent 1fc1398 commit 8d369d3
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Clop/bin-*/*
Releases/*.html
required.swift
Releases/old_updates/
*.tmp
32 changes: 16 additions & 16 deletions Clop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.5.2;
CURRENT_PROJECT_VERSION = 2.5.3;
DEVELOPMENT_TEAM = RDDXV84A73;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -898,7 +898,7 @@
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.5.2;
MARKETING_VERSION = 2.5.3;
PRODUCT_BUNDLE_IDENTIFIER = com.lowtechguys.Clop.FinderOptimiser;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -917,7 +917,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.5.2;
CURRENT_PROJECT_VERSION = 2.5.3;
DEVELOPMENT_TEAM = RDDXV84A73;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -933,7 +933,7 @@
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.5.2;
MARKETING_VERSION = 2.5.3;
PRODUCT_BUNDLE_IDENTIFIER = com.lowtechguys.Clop.FinderOptimiser;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -952,7 +952,7 @@
CODE_SIGN_ENTITLEMENTS = Setapp/Setapp.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.5.2;
CURRENT_PROJECT_VERSION = 2.5.3;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Clop/Preview Content\"";
DEVELOPMENT_TEAM = RDDXV84A73;
Expand All @@ -974,7 +974,7 @@
);
LLVM_LTO = YES_THIN;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.5.2;
MARKETING_VERSION = 2.5.3;
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libSetapp.a",
Expand All @@ -996,7 +996,7 @@
CODE_SIGN_ENTITLEMENTS = Setapp/Setapp.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.5.2;
CURRENT_PROJECT_VERSION = 2.5.3;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Clop/Preview Content\"";
DEVELOPMENT_TEAM = RDDXV84A73;
Expand All @@ -1018,7 +1018,7 @@
);
LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.5.2;
MARKETING_VERSION = 2.5.3;
OTHER_LDFLAGS = (
"-force_load",
"$(BUILT_PRODUCTS_DIR)/libSetapp.a",
Expand All @@ -1038,7 +1038,7 @@
CODE_SIGN_ENTITLEMENTS = "Setapp/FinderOptimiser-setapp.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.5.2;
CURRENT_PROJECT_VERSION = 2.5.3;
DEVELOPMENT_TEAM = RDDXV84A73;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -1053,7 +1053,7 @@
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.5.2;
MARKETING_VERSION = 2.5.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.lowtechguys.Clop-setapp.FinderOptimiser";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -1070,7 +1070,7 @@
CODE_SIGN_ENTITLEMENTS = "Setapp/FinderOptimiser-setapp.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.5.2;
CURRENT_PROJECT_VERSION = 2.5.3;
DEVELOPMENT_TEAM = RDDXV84A73;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -1085,7 +1085,7 @@
);
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.5.2;
MARKETING_VERSION = 2.5.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.lowtechguys.Clop-setapp.FinderOptimiser";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -1323,7 +1323,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.5.2;
CURRENT_PROJECT_VERSION = 2.5.3;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Clop/Preview Content\"";
DEVELOPMENT_TEAM = RDDXV84A73;
Expand All @@ -1344,7 +1344,7 @@
);
LLVM_LTO = YES_THIN;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.5.2;
MARKETING_VERSION = 2.5.3;
PRODUCT_BUNDLE_IDENTIFIER = com.lowtechguys.Clop;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1363,7 +1363,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.5.2;
CURRENT_PROJECT_VERSION = 2.5.3;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Clop/Preview Content\"";
DEVELOPMENT_TEAM = RDDXV84A73;
Expand All @@ -1384,7 +1384,7 @@
);
LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.5.2;
MARKETING_VERSION = 2.5.3;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.lowtechguys.Clop;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
<VariablesViewState
version = "1.0">
<ContextStates>
<ContextState
contextName = "optimiseItem(_:id:hideFloatingResult:downscaleTo:cropTo:changePlaybackSpeedBy:aggressiveOptimisation:optimisationCount:copyToClipboard:source:output:removeAudio:):OptimisationUtils.swift">
<PersistentStrings>
<PersistentString
value = "path.string">
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
contextName = "LowtechWindow.screenCorner.didset:OSDWindow.swift">
<PersistentStrings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
<key>ClopCLI-setapp.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<key>ClopCLI.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
<integer>5</integer>
</dict>
<key>Example (Playground) 1.xcscheme</key>
<dict>
Expand Down Expand Up @@ -95,12 +95,12 @@
<key>FinderOptimiser-setapp.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
<integer>4</integer>
</dict>
<key>FinderOptimiser.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
<integer>2</integer>
</dict>
<key>Setapp.xcscheme_^#shared#^_</key>
<dict>
Expand Down
2 changes: 1 addition & 1 deletion Clop/ClopApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ class AppDelegate: AppDelegateParent {
trialText = "This is a trial for the Pro features. After the trial, the app will automatically revert to the free version."
price = 15
productName = "Clop Pro"
vendorName = "The low-tech guys"
vendorName = "THE LOW TECH GUYS SRL"
hasFreeFeatures = true
#endif

Expand Down
20 changes: 13 additions & 7 deletions Clop/Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,10 @@ class Image: CustomStringConvertible {
var newOutFile = pngOutFile
do {
if Defaults[.convertedImageBehaviour] != .temporary {
pngOutFile.copyExif(from: backup ?? path, excludeTags: retinaDownscaled ? ["XResolution", "YResolution"] : nil, stripMetadata: Defaults[.stripMetadata])
try pngOutFile.setOptimisationStatusXattr("true")
newOutFile = try pngOutFile.copy(to: path.dir)

newOutFile = try pngOutFile.move(to: path.dir, force: true)
if Defaults[.convertedImageBehaviour] == .inPlace, let ext = path.extension, newOutFile.withExtension(ext).exists {
try? newOutFile.withExtension(ext).delete()
}
Expand All @@ -545,7 +547,9 @@ class Image: CustomStringConvertible {
}
}

tempFile.copyExif(from: backup ?? path, excludeTags: retinaDownscaled ? ["XResolution", "YResolution"] : nil, stripMetadata: Defaults[.stripMetadata])
if type == .jpeg || Defaults[.convertedImageBehaviour] == .temporary {
tempFile.copyExif(from: backup ?? path, excludeTags: retinaDownscaled ? ["XResolution", "YResolution"] : nil, stripMetadata: Defaults[.stripMetadata])
}
if Defaults[.preserveDates] {
tempFile.copyCreationModificationDates(from: backup ?? path)
}
Expand Down Expand Up @@ -640,9 +644,11 @@ class Image: CustomStringConvertible {
var newOutFile = jpegOutFile
do {
if Defaults[.convertedImageBehaviour] != .temporary {
jpegOutFile.copyExif(from: backup ?? path, excludeTags: retinaDownscaled ? ["XResolution", "YResolution"] : nil, stripMetadata: Defaults[.stripMetadata])
try jpegOutFile.setOptimisationStatusXattr("true")

if jpegOutFile != path.dir.appending(jpegOutFile.name) {
newOutFile = try jpegOutFile.copy(to: path.dir)
newOutFile = try jpegOutFile.move(to: path.dir, force: true)
if Defaults[.convertedImageBehaviour] == .inPlace, let ext = path.extension, newOutFile.withExtension(ext).exists {
try? newOutFile.withExtension(ext).delete()
}
Expand All @@ -656,7 +662,9 @@ class Image: CustomStringConvertible {
}
}

tempFile.copyExif(from: backup ?? path, excludeTags: retinaDownscaled ? ["XResolution", "YResolution"] : nil, stripMetadata: Defaults[.stripMetadata])
if type == .png || Defaults[.convertedImageBehaviour] == .temporary {
tempFile.copyExif(from: backup ?? path, excludeTags: retinaDownscaled ? ["XResolution", "YResolution"] : nil, stripMetadata: Defaults[.stripMetadata])
}
if Defaults[.preserveDates] {
tempFile.copyCreationModificationDates(from: backup ?? path)
}
Expand Down Expand Up @@ -692,9 +700,7 @@ class Image: CustomStringConvertible {

let size = cropSize.computedSize(from: size)
let sizeStr = "\(size.width.evenInt)x\(size.height.evenInt)"
let args = ["-s", sizeStr, "-o", "%s_\(sizeStr).\(path.extension!)", "--linear"]
+ (cropSize.smartCrop ? ["--smartcrop", "attention"] : [])
+ [pathForResize.string]
let args = ["-s", sizeStr, "-o", "%s_\(sizeStr).\(path.extension!)", "--linear", "--smartcrop", cropSize.smartCrop ? "attention" : "centre", pathForResize.string]
let proc = try tryProc(VIPSTHUMBNAIL.string, args: args, tries: 3) { proc in
mainActor { optimiser.processes = [proc] }
}
Expand Down
2 changes: 1 addition & 1 deletion Clop/OptimisationUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,7 @@ func processOptimisationRequest(_ req: OptimisationRequest) async throws -> [Opt
throw ClopError.optimisationFailed(url.shellString)
}

if let optURL = respPath.fileURL, optURL != url, optURL.deletingLastPathComponent() != url.deletingLastPathComponent() {
if req.output == nil, let optURL = respPath.fileURL, optURL != url, optURL.deletingLastPathComponent() != url.deletingLastPathComponent() {
let newURL = url.deletingLastPathComponent().appendingPathComponent(optURL.lastPathComponent)
if fm.fileExists(atPath: newURL.path) {
try fm.removeItem(at: newURL)
Expand Down
12 changes: 10 additions & 2 deletions ClopCLI/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1167,13 +1167,21 @@ actor ProgressPrinter {
} else {
""
}
let savedAs = if let original = response.forURL.filePath ?? response.convertedFrom?.filePath, let optimised = response.path.filePath, original != optimised {
" saved as \(optimised.shellString.underline())".dim()
} else {
""
}
print(
"\(CHECKMARK) \(response.forURL.shellString.underline()): \(response.oldBytes.humanSize.foregroundColor(isSmaller ? .red : .green)) \(ARROW) \(response.newBytes.humanSize.foregroundColor(isSmaller ? .green : .red).bold())\(resolutionChangeStr)\(percentageSaved)"
"\(CHECKMARK) \(response.forURL.shellString.underline()): \(response.oldBytes.humanSize.foregroundColor(isSmaller ? .red : .green)) \(ARROW) \(response.newBytes.humanSize.foregroundColor(isSmaller ? .green : .red).bold())\(resolutionChangeStr)\(percentageSaved)\(savedAs)"
)
}
for response in errors.values.sorted(by: { $0.forURL.path < $1.forURL.path }) {
let url = response.forURL
print("\(ERROR_X) \(url.shellString.underline()): \(response.error.replacingOccurrences(of: ": \(url.path)", with: "").foregroundColor(.red))")
let err = response.error
.replacingOccurrences(of: ": \(url.path)", with: "")
.replacingOccurrences(of: ": \(url.shellString)", with: "")
print("\(ERROR_X) \(url.shellString.underline()): \(err.foregroundColor(.red))")
}
if responses.count > 1 {
let totalOldBytes = responses.values.map(\.oldBytes).reduce(0, +)
Expand Down
25 changes: 14 additions & 11 deletions Releases/appcast.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
<?xml version="1.0" standalone="yes"?>
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<item>
<title>2.5.3</title>
<pubDate>Tue, 02 Jan 2024 17:36:30 +0200</pubDate>
<link>https://lowtechguys.com/clop</link>
<sparkle:fullReleaseNotesLink>https://github.com/FuzzyIdeas/Clop/releases</sparkle:fullReleaseNotesLink>
<sparkle:version>2.5.3</sparkle:version>
<sparkle:shortVersionString>2.5.3</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<sparkle:releaseNotesLink>https://files.lowtechguys.com/ReleaseNotes/Clop-2.5.3.html</sparkle:releaseNotesLink>
<enclosure url="https://files.lowtechguys.com/releases/Clop-2.5.3.dmg" length="92248198" type="application/octet-stream" sparkle:edSignature="dA9jc7yQv1ZrzLJDQoJ87dl+YUsudpe8gCxpOsii6oj42jm+Oyop6ttoji/zPQw+pGbp6jMrELbqEXw7VClABw=="/>
<sparkle:deltas>
<enclosure url="https://files.lowtechguys.com/releases/Clop2.5.3-2.5.2.delta" sparkle:deltaFrom="2.5.2" length="1400690" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="865120" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="TJmpEugpjlnXr8u1d+DrJ0AXayYOYMwTnqao6VZdgKmQOIiEufkXnSPgY5EwdSOjEiY28yBooH4b3NBdlY3ZBA=="/>
</sparkle:deltas>
</item>
<item>
<title>2.5.2</title>
<pubDate>Thu, 21 Dec 2023 18:43:54 +0200</pubDate>
Expand Down Expand Up @@ -135,16 +149,5 @@
<enclosure url="https://files.lowtechguys.com/releases/Clop2.2.5-2.2.4.delta" sparkle:deltaFrom="2.2.4" length="1140934" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="865120" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="g1P1G9IgUxRCmM6SrlpCzsOnLIIHLI7/Y90nIcQ8j9VKEx/aRoz6WeckoKqfbI9hp06jQ1sBWq6GpK+nzqAUAQ=="/>
</sparkle:deltas>
</item>
<item>
<title>2.2.4</title>
<pubDate>Sat, 14 Oct 2023 11:11:13 +0300</pubDate>
<link>https://lowtechguys.com/clop</link>
<sparkle:fullReleaseNotesLink>https://github.com/FuzzyIdeas/Clop/releases</sparkle:fullReleaseNotesLink>
<sparkle:version>2.2.4</sparkle:version>
<sparkle:shortVersionString>2.2.4</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<sparkle:releaseNotesLink>https://files.lowtechguys.com/ReleaseNotes/Clop-2.2.4.html</sparkle:releaseNotesLink>
<enclosure url="https://files.lowtechguys.com/releases/Clop-2.2.4.dmg" length="83673298" type="application/octet-stream" sparkle:edSignature="oDVXttBwW9y0bArM6gxixhT1pHbkQBMe61l7aeJWgv7lNYRNqVR373wplcpyhWpX9AW7iOyu1wxToFHqWWvtAw=="/>
</item>
</channel>
</rss>

0 comments on commit 8d369d3

Please sign in to comment.