Skip to content

Commit

Permalink
2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alin23 committed Aug 22, 2023
1 parent a37be99 commit 446b4bc
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 20 deletions.
29 changes: 25 additions & 4 deletions Clop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
C7AB661D288301590041BEC8 /* Sources */,
C7AB661E288301590041BEC8 /* Frameworks */,
C7AB661F288301590041BEC8 /* Resources */,
C71A88752A94AFAA00ABD6EE /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -232,6 +233,26 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
C71A88752A94AFAA00ABD6EE /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "mkdir -p \"$CODESIGNING_FOLDER_PATH/Contents/_MASReceipt\"\ntouch \"$CODESIGNING_FOLDER_PATH/Contents/_MASReceipt/receipt\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
C7AB661D288301590041BEC8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -380,7 +401,7 @@
CODE_SIGN_ENTITLEMENTS = Clop/Clop.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.1.1;
CURRENT_PROJECT_VERSION = 2.1.2;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Clop/Preview Content\"";
DEVELOPMENT_TEAM = RDDXV84A73;
Expand All @@ -400,7 +421,7 @@
"$(PROJECT_DIR)/Clop/bin",
);
LLVM_LTO = YES_THIN;
MARKETING_VERSION = 2.1.1;
MARKETING_VERSION = 2.1.2;
PRODUCT_BUNDLE_IDENTIFIER = com.lowtechguys.Clop;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -416,7 +437,7 @@
CODE_SIGN_ENTITLEMENTS = Clop/Clop.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2.1.1;
CURRENT_PROJECT_VERSION = 2.1.2;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Clop/Preview Content\"";
DEVELOPMENT_TEAM = RDDXV84A73;
Expand All @@ -436,7 +457,7 @@
"$(PROJECT_DIR)/Clop/bin",
);
LLVM_LTO = YES;
MARKETING_VERSION = 2.1.1;
MARKETING_VERSION = 2.1.2;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.lowtechguys.Clop;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
22 changes: 7 additions & 15 deletions Clop/Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,6 @@ class Image: CustomStringConvertible {
pasteboardItem.types.contains(where: { $0.rawValue.contains("raw-image") })
}

class func fromCommandLine() throws -> Image {
let impath = CommandLine.arguments[1]
guard fm.fileExists(atPath: impath) else {
throw ClopError.fileNotFound(FilePath(impath))
}

guard let data = fm.contents(atPath: impath), NSImage(data: data) != nil else {
throw ClopError.fileNotImage(FilePath(impath))
}
return Image(data: data, path: FilePath(impath), retinaDownscaled: false)
}

class func fromPasteboard(item: NSPasteboardItem? = nil, anyType: Bool = false) throws -> Image {
let pb = NSPasteboard.general
guard let item = item ?? pb.pasteboardItems?.first else {
Expand Down Expand Up @@ -659,6 +647,10 @@ class Image: CustomStringConvertible {
var allowLarger = allowLarger
var originalPath: FilePath?
let applyConversionBehaviour: (Image, Image) throws -> Image = { img, converted in
guard img.path.dir != FilePath.images else {
return converted
}

let behaviour = Defaults[.convertedImageBehaviour]
if behaviour == .inPlace {
img.path.backup(force: true, operation: .move)
Expand Down Expand Up @@ -727,10 +719,10 @@ class Image: CustomStringConvertible {
if shouldDownscale {
img.retinaDownscaled = true
mainActor { optimiser.retinaDownscaled = true }
optimisedImage = try img.resize(toFraction: (1.0 / img.pixelScale).d, optimiser: optimiser, aggressiveOptimisation: aggressiveOptimisation, adaptiveSize: id == Optimiser.IDs.clipboardImage)
optimisedImage = try img.resize(toFraction: (1.0 / img.pixelScale).d, optimiser: optimiser, aggressiveOptimisation: aggressiveOptimisation, adaptiveSize: Defaults[.adaptiveImageSize])
mainActor { optimiser.downscaleFactor = (1.0 / img.pixelScale).d }
} else {
optimisedImage = try img.optimise(optimiser: optimiser, allowLarger: allowLarger, aggressiveOptimisation: aggressiveOptimisation, adaptiveSize: id == Optimiser.IDs.clipboardImage)
optimisedImage = try img.optimise(optimiser: optimiser, allowLarger: allowLarger, aggressiveOptimisation: aggressiveOptimisation, adaptiveSize: Defaults[.adaptiveImageSize])
}
if optimisedImage!.type == img.type {
try optimisedImage!.path.copy(to: img.path, force: true)
Expand Down Expand Up @@ -826,7 +818,7 @@ class Image: CustomStringConvertible {
OM.current = optimiser
}
do {
let resized = try img.resize(toFraction: scalingFactor, optimiser: optimiser, aggressiveOptimisation: aggressive, adaptiveSize: id == Optimiser.IDs.clipboardImage)
let resized = try img.resize(toFraction: scalingFactor, optimiser: optimiser, aggressiveOptimisation: aggressive, adaptiveSize: Defaults[.adaptiveImageSize])
if id != Optimiser.IDs.clipboardImage, resized.type == img.type {
try resized.path.copy(to: savePath ?? img.path, force: true)
} else {
Expand Down
2 changes: 1 addition & 1 deletion Clop/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public extension Defaults.Keys {
static let imageFormatsToSkip = Key<Set<UTType>>("imageFormatsToSkip", default: [.tiff])
static let videoFormatsToSkip = Key<Set<UTType>>("videoFormatsToSkip", default: [UTType.mkv, UTType.m4v].compactMap { $0 }.set)
static let adaptiveVideoSize = Key<Bool>("adaptiveVideoSize", default: true)
static let adaptiveImageSize = Key<Bool>("adaptiveVideoSize", default: true)
static let adaptiveImageSize = Key<Bool>("adaptiveImageSize", default: true)
static let downscaleRetinaImages = Key<Bool>("downscaleRetinaImages", default: false)

static let showFloatingHatIcon = Key<Bool>("showFloatingHatIcon", default: true)
Expand Down
8 changes: 8 additions & 0 deletions ReleaseNotes/2.1.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Improvements

- Make app uninstallable from Launchpad

## Fixes

- Fix adaptive optimisation not working on all images
- Some files were getting ignored because of the new "converted file location" setting
18 changes: 18 additions & 0 deletions Releases/appcast.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
<?xml version="1.0" standalone="yes"?>
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<item>
<title>2.1.2</title>
<pubDate>Tue, 22 Aug 2023 17:52:54 +0300</pubDate>
<link>https://lowtechguys.com/clop</link>
<sparkle:fullReleaseNotesLink>https://github.com/FuzzyIdeas/Clop/releases</sparkle:fullReleaseNotesLink>
<sparkle:version>2.1.2</sparkle:version>
<sparkle:shortVersionString>2.1.2</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>13.0</sparkle:minimumSystemVersion>
<sparkle:releaseNotesLink>https://files.lowtechguys.com/ReleaseNotes/Clop-2.1.2.html</sparkle:releaseNotesLink>
<enclosure url="https://files.lowtechguys.com/releases/Clop-2.1.2.dmg" length="52826655" type="application/octet-stream" sparkle:edSignature="YodnzNBaP02M0UBAu5c0W7n81GyyZUD39XK2q7wdyD6a6io3+StHYDOXf3llT0WAdtTRB8PMTnklSOS8KjyQCg=="/>
<sparkle:deltas>
<enclosure url="https://files.lowtechguys.com/releases/Clop2.1.2-2.1.1.delta" sparkle:deltaFrom="2.1.1" length="250114" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="865040" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="oQNehq30Xda5ROu5O4AyPR7081jFt586s+FibJ0QsVCJFO3AiIQ3HaMGudznAas5z0i4Job+sTSw37r5cK2hDA=="/>
<enclosure url="https://files.lowtechguys.com/releases/Clop2.1.2-2.0.3.delta" sparkle:deltaFrom="2.0.3" length="1004490" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="865040" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="BuJobsyVupoYKLnnTxb8ntH916DtKgIH9Eyx6PlVQpgVfsudNVtm43FMm5CgwcPIFq2jgZLK3eNVffKFBXkqCQ=="/>
<enclosure url="https://files.lowtechguys.com/releases/Clop2.1.2-2.0.2.delta" sparkle:deltaFrom="2.0.2" length="1114878" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="865040" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="D961GNTIzyQ1kaMU/fe2G0U/2yJ8kNTOUo2xijX/5jq7DBki2AXsUmbM42edwu9JNDhX7OAnLRA777JrjFo2Ag=="/>
<enclosure url="https://files.lowtechguys.com/releases/Clop2.1.2-2.0.1.delta" sparkle:deltaFrom="2.0.1" length="1120398" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="865040" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="G4Fd1e5/iD95WnMuIpR5D5zghQ+pV6oBNBC8NQSPPSik90oLwpfelKScUVFzwdxmDF7V1C2jx5uUODnynI7IBw=="/>
<enclosure url="https://files.lowtechguys.com/releases/Clop2.1.2-2.0.0.delta" sparkle:deltaFrom="2.0.0" length="1130122" type="application/octet-stream" sparkle:deltaFromSparkleExecutableSize="865040" sparkle:deltaFromSparkleLocales="de,he,ar,el,ja,fa,en" sparkle:edSignature="ryAM/Rl1eKYXC2QJvfSoPofW19gp/vxGsXyJgwi9edxyWl/Yg/YdS9zSiK2gdW005P5BR0DrvkKR1nUQpmpcBA=="/>
</sparkle:deltas>
</item>
<item>
<title>2.1.1</title>
<pubDate>Mon, 21 Aug 2023 16:08:54 +0300</pubDate>
Expand Down

0 comments on commit 446b4bc

Please sign in to comment.