From e87052cd7580bc7177fc2917fe631cccdb4fed42 Mon Sep 17 00:00:00 2001 From: ema Date: Thu, 23 Apr 2026 01:39:54 +0800 Subject: [PATCH] Slow down ARM64 support --- .../QuickLook.Plugin.ImageViewer.csproj | 5 ++ .../QuickLook.Plugin.PdfViewer.csproj | 6 +- Scripts/dir-diff.ps1 | 78 +++++++++++++++++++ 3 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 Scripts/dir-diff.ps1 diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj index 9c19bdf..059f1c6 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj @@ -136,8 +136,13 @@ + + + + + diff --git a/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/QuickLook.Plugin.PdfViewer.csproj b/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/QuickLook.Plugin.PdfViewer.csproj index 57d3473..f026584 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/QuickLook.Plugin.PdfViewer.csproj +++ b/QuickLook.Plugin/QuickLook.Plugin.PDFViewer/QuickLook.Plugin.PdfViewer.csproj @@ -108,12 +108,10 @@ + + - - - - diff --git a/Scripts/dir-diff.ps1 b/Scripts/dir-diff.ps1 new file mode 100644 index 0000000..21f0c8c --- /dev/null +++ b/Scripts/dir-diff.ps1 @@ -0,0 +1,78 @@ +param( + [Parameter(Mandatory=$true)] + [string]$DirA, + + [Parameter(Mandatory=$true)] + [string]$DirB, + + [switch]$Full +) + +[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 + +function Get-Map($root) { + + $root = (Resolve-Path $root).Path.TrimEnd('\') + + $map = @{} + + Get-ChildItem $root -Recurse -File | ForEach-Object { + + $rel = $_.FullName.Substring($root.Length).TrimStart('\') + $map[$rel] = $_.Length + } + + return $map +} + +function Format-Size([long]$bytes) { + + if ($bytes -ge 1GB) { return "{0:N2} GB" -f ($bytes / 1GB) } + if ($bytes -ge 1MB) { return "{0:N2} MB" -f ($bytes / 1MB) } + if ($bytes -ge 1KB) { return "{0:N2} KB" -f ($bytes / 1KB) } + return "$bytes B" +} + +$mapA = Get-Map $DirA +$mapB = Get-Map $DirB + +$allKeys = ($mapA.Keys + $mapB.Keys) | Sort-Object -Unique + +foreach ($k in $allKeys) { + + $aHas = $mapA.ContainsKey($k) + $bHas = $mapB.ContainsKey($k) + + $sizeA = if ($aHas) { $mapA[$k] } else { 0 } + $sizeB = if ($bHas) { $mapB[$k] } else { 0 } + + $diff = $sizeB - $sizeA + + $aStr = Format-Size $sizeA + $bStr = Format-Size $sizeB + $diffStr = Format-Size ([math]::Abs($diff)) + + if (-not $Full -and $diff -eq 0 -and $aHas -and $bHas) { + continue + } + + if (-not $aHas) { + + Write-Host "[+] $k ($aStr → $bStr, +$diffStr)" -ForegroundColor Green + } + elseif (-not $bHas) { + + Write-Host "[-] $k ($aStr → $bStr, -$diffStr)" -ForegroundColor Red + } + elseif ($diff -eq 0) { + + Write-Host "[=] $k ($aStr → $bStr, 0 B)" -ForegroundColor DarkGray + } + else { + + $color = if ($diff -gt 0) { "Yellow" } else { "Cyan" } + $sign = if ($diff -gt 0) { "+" } else { "-" } + + Write-Host "[~] $k ($aStr → $bStr, $sign$diffStr)" -ForegroundColor $color + } +}