mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-07-08 03:20:50 +02:00
Compare commits
3 Commits
issue/4435
...
issue/1929
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0180299734 | ||
|
|
87c65f9eec | ||
|
|
971c7e9fba |
@@ -18,13 +18,28 @@ Advanced Paste is a PowerToys module that provides enhanced clipboard pasting wi
|
||||
|
||||
TODO: Add implementation details
|
||||
|
||||
### Paste with AI Preview
|
||||
|
||||
The "Show preview" setting (`ShowCustomPreview`) controls whether AI-generated results are displayed in a preview window before pasting. **The preview feature does not consume additional AI credits**—the preview displays the same AI response that was already generated, cached locally from a single API call.
|
||||
|
||||
The implementation flow:
|
||||
1. User initiates "Paste with AI" action
|
||||
2. A single AI API call is made via `ExecutePasteFormatAsync`
|
||||
3. The result is cached in `GeneratedResponses`
|
||||
4. If preview is enabled, the cached result is displayed in the preview UI
|
||||
5. User can paste the cached result without any additional API calls
|
||||
|
||||
See the `ExecutePasteFormatAsync(PasteFormat, PasteActionSource)` method in `OptionsViewModel.cs` for the implementation.
|
||||
|
||||
## Debugging
|
||||
|
||||
TODO: Add debugging information
|
||||
|
||||
## Settings
|
||||
|
||||
TODO: Add settings documentation
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| `ShowCustomPreview` | When enabled, shows AI-generated results in a preview window before pasting. Does not affect AI credit consumption. |
|
||||
|
||||
## Future Improvements
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
// SupportedFormatsRegistry.cs
|
||||
// Fix for Issue #1929: Show "Resize pictures" on all supported formats
|
||||
// Extends context menu to all image formats Image Resizer can handle
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace ImageResizer.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Registry of all image formats supported by Image Resizer.
|
||||
/// </summary>
|
||||
public static class SupportedFormatsRegistry
|
||||
{
|
||||
/// <summary>
|
||||
/// All file extensions that Image Resizer can process.
|
||||
/// </summary>
|
||||
public static readonly IReadOnlyList<string> SupportedExtensions = new[]
|
||||
{
|
||||
// Common formats
|
||||
".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff", ".tif",
|
||||
// Web formats
|
||||
".webp", ".svg", ".ico",
|
||||
// RAW formats (read-only, converts to supported output)
|
||||
".raw", ".cr2", ".cr3", ".nef", ".arw", ".dng", ".orf", ".rw2",
|
||||
// HDR formats
|
||||
".hdr", ".exr",
|
||||
// Other formats
|
||||
".heic", ".heif", ".avif", ".jxl",
|
||||
// Less common but supported
|
||||
".pbm", ".pgm", ".ppm", ".pnm", ".pcx", ".tga"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a file extension is supported for resizing.
|
||||
/// </summary>
|
||||
public static bool IsSupported(string extension)
|
||||
{
|
||||
if (string.IsNullOrEmpty(extension))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var ext = extension.StartsWith(".") ? extension : "." + extension;
|
||||
return SupportedExtensions.Contains(ext, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the registry format string for shell integration.
|
||||
/// </summary>
|
||||
public static string GetShellAssociations()
|
||||
{
|
||||
return string.Join(";", SupportedExtensions.Select(e => $"*{e}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4121,7 +4121,7 @@ Activate by holding the key for the character you want to add an accent to, then
|
||||
<value>Advanced AI</value>
|
||||
</data>
|
||||
<data name="Oobe_AdvancedPaste.Description" xml:space="preserve">
|
||||
<value>Advanced Paste is a tool to put your clipboard content into any format you need, focused towards developer workflows. It can paste as plain text, markdown, or json directly with the UX or with a direct keystroke invoke. These are fully locally executed. In addition, it has an AI powered option that is 100% opt-in and requires an Open AI key. Note: this will replace the formatted text in your clipboard with the selected format.</value>
|
||||
<value>Advanced Paste is a tool to put your clipboard content into any format you need, focused towards developer workflows. It can paste as plain text, Markdown, or JSON directly with the UX or with a direct keystroke invoke. These are fully locally executed. In addition, it has an opt-in AI feature that can use an online or local language model endpoint. Note: this will replace the formatted text in your clipboard with the selected format.</value>
|
||||
</data>
|
||||
<data name="Oobe_AdvancedPaste.Title" xml:space="preserve">
|
||||
<value>Advanced Paste</value>
|
||||
|
||||
Reference in New Issue
Block a user