Skip to content

Commit

Permalink
v4.0.5 (GUI)
Browse files Browse the repository at this point in the history
  • Loading branch information
Decimation committed May 10, 2024
1 parent da13d41 commit de57f00
Show file tree
Hide file tree
Showing 12 changed files with 359 additions and 23 deletions.
35 changes: 35 additions & 0 deletions Assets/Legacy1_CommandLine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Configuration

## Search Engines

`-se <engines>` _(parameter)_

Specifies engines with a comma-separated list of search engine names

## Priority Engines

`-pe <engines>` _(parameter)_

Specifies priority engines with a comma-separated list of search engine names

## Filtering

`-f` _(switch)_

Enables filtering of results (omit to disable)

# Input

The last parameter should be the image query.

# Examples

`smartimage -se All -pe SauceNao 'https://litter.catbox.moe/x8jfkj.jpg'`

Runs a search of `https://litter.catbox.moe/x8jfkj.jpg` with `All` search engines, and `SauceNao` as a priority engine.

<br></br>

`smartimage 'C:\Users\<User>\Downloads\image.jpg'`

Runs a search of `C:\Users\<User>\Downloads\image.jpg` with configuration from the config file.
70 changes: 70 additions & 0 deletions Assets/Legacy1_Configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Settings

**SmartImage** is highly customizable. The following table lists config options.

| Setting | Description |
|--|--|
| Search engines | Engines to use when searching. |
| Priority engines | Engines whose results are opened in the browser.|
| Filtering | Hides low-quality and unsuccessful results. |
| Notification | Displays a toast notification with result information once the search is completed.|
| Notification image | Includes a preview image in the toast notification. |
| Context menu | Integrates **SmartImage** into the context menu (right-click menu). |

These settings can be configured in different ways:

- The main menu
- The command line


# Engines

## Options

Search engine names and configuration:

| Real Name | Option Name |
| --------------- | --------------- |
| (All) | `All` |
| (None) | `None` |
| (Auto) | `Auto` |
| (Artwork) | `Artwork` |
| SauceNao | `SauceNao` |
| ImgOps | `ImgOps` |
| Google Images | `GoogleImages` |
| TinEye | `TinEye` |
| IQDB | `Iqdb` |
| trace.moe | `TraceMoe` |
| Karma Decay | `KarmaDecay` |
| Yandex | `Yandex` |
| Bing | `Bing` |
| Tidder | `Tidder` |
| Ascii2D | `Ascii2D` |

Special options:
- `All`: Use all available engines
- `None`: Use no engines<sup>1</sup>
- `Auto`: Use the best engine result<sup>1</sup>
- `Artwork`: The engines *SauceNao*, *IQDB*, *Ascii2D*

<sup>1</sup> This option can only be used with priority engine options. They cannot be used for the main search engine options.

## Search Engines

These options are the engines used to perform searches.

## Priority Search Engines

These options are the engines whose results will be opened in your browser. If `Auto` is used, the best result is opened. If `None` is used,
no results will be opened in the browser.


# Behavior

Configuration is loaded in this order:
1. Configuration file (`SmartImage.cfg`)
2. Command line parameters (if specified)

Therefore, command line parameters have precedence over the config file. For example, if the config file designates `SauceNao` as a priority engine but the command line argument `-pe Iqdb` is specified, `Iqdb` will take precedence.

This can be useful when you want to run a search with certain settings but want to keep your personalized configuration intact.
97 changes: 97 additions & 0 deletions Assets/Legacy1_Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
```
____ _ ___
/ ___| _ __ ___ __ _ _ __| |_|_ _|_ __ ___ __ _ __ _ ___
\___ \| '_ ` _ \ / _` | '__| __|| || '_ ` _ \ / _` |/ _` |/ _ \
___) | | | | | | (_| | | | |_ | || | | | | | (_| | (_| | __/
|____/|_| |_| |_|\__,_|_| \__|___|_| |_| |_|\__,_|\__, |\___|
|___/
```

Welcome to the **SmartImage** wiki!

# Installation

## Requirements

The only requirements are .NET 6 and Windows. You can check if .NET 6 is installed by running
one of the following commands:

`dotnet --list-runtimes`: <br />
_Output:_ `Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]`

`dotnet --list-sdks`: <br />
_Output:_ `6.0.100 [C:\Program Files\dotnet\sdk]`

If the version major number is 6 (i.e., first number in the version), then .NET 6 is installed.

***

**SmartImage** must be added to the system PATH (*`%PATH%`*) environment variable, otherwise context menu integration will not work. **SmartImage** will automatically do this for you. Otherwise, you can read about how to manually do this [here](https://superuser.com/questions/949560/how-do-i-set-system-environment-variables-in-windows-10).

If the IME (system language) is a non-Romance language (e.g., Japanese or Chinese), some features may not work correctly (i.e., keyboard input, context menu integration). To resolve this, set the IME to English.

# Engines

Supported search engines and notes:

- <img src="https://saucenao.com/favicon.ico" width="16" height="16"/> [SauceNao](https://saucenao.com/)
- Multi-service image search
- **Use case:** Finding sauce, usually artwork
- <img src="https://iqdb.org/favicon.ico" width="16" height="16"/> [IQDB](https://iqdb.org/)
- Multi-service image search
- Similar to *SauceNao*
- **Use case:** Finding sauce, usually artwork
- <img src="https://trace.moe/favicon128.png" width="16" height="16"/> [trace.moe](https://trace.moe/)
- Multi-database image search
- **Use case:** Identifying anime from a screenshot
- <img src="http://karmadecay.com/favicon.ico" width="16" height="16"/> [Karma Decay](http://karmadecay.com/)
- Reddit image search
- **Disclaimer:** Very slow
- <img src="http://imgops.com/favicon.ico" width="16" height="16"/> [ImgOps](http://imgops.com/)
- Multi-service image search
- **Use case:** Performing multiple image operations
- **Restrictions:** Max upload size is 5MB
- <img src="https://images.google.com/favicon.ico" width="16" height="16"/> [Google Images](https://images.google.com/)
- General-purpose image search
- <img src="https://tineye.com/favicon.ico" width="16" height="16"/> [TinEye](https://tineye.com/)
- General-purpose image search
- Generally better than *Google Images*
- <img src="https://yandex.com/favicon.ico" width="16" height="16"/> [Yandex](https://yandex.com/images/)
- General-purpose image search
- **Disclaimer:** Russian
- <img src="https://www.bing.com/favicon.ico" width="16" height="16"/> [Bing](https://www.bing.com/images/)
- General-purpose image search
- <img src="http://tidder.xyz/favicon.ico" width="16" height="16"/> [Tidder](http://tidder.xyz/)
- Reddit image search
- Generally better than *Karma Decay*
- <img src="https://ascii2d.net/favicon.ico" width="16" height="16"/> [Ascii2D](https://ascii2d.net/)
- Multi-service image search
- Similar to *SauceNao* and *IQDB*
- **Use case:** Finding sauce, usually artwork

***


# Usage

<b>SmartImage</b> can be used in multiple ways:

- Open the program normally (double click) and you can use the program in a user-friendly way. You can then drag and drop your image into the command prompt and run a search.

<p align="center">
<img src="https://github.com/Decimation/SmartImage/raw/master/Examples/Demo%203.gif" width="636.35" height="370.7">
</p>

- Right-click on an image (once the context menu integration is set up) and select the <b>SmartImage</b> option to immediately perform a search.

<p align="center">
<img src="https://github.com/Decimation/SmartImage/raw/master/Examples/Demo%201.gif" width="640" height="360">
</p>

- Drag and drop an image over the executable to immediately perform a search (functionally the same as right-clicking on an image and using the <b>SmartImage</b> option).

<p align="center">
<img src="https://github.com/Decimation/SmartImage/raw/master/Examples/Demo%202.gif" width="636.35" height="370.7">
</p>

- Use the command line.
73 changes: 73 additions & 0 deletions Assets/Legacy1_Interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Main menu

<img align="right" src="https://github.com/Decimation/SmartImage/raw/master/Examples/Main%20menu.png" width=601 height=316>

<p style="text-align: left;">


- **Run**: Runs a search
- **Engines**: Configures engines
- **Priority engines**: Configures priority engines
- **Filter**: Toggles filtering
- **Notification**: Toggles toast notification
- **Notification image**: Toggles toast notification image
- **Context menu**: Toggles context menu integration
- **Config**: Displays current configuration
- **Info**: Displays program info
- **Update**: Checks and installs new versions
- **Help**: Opens help


<!-- todo
-->


</p>

<br /><br />

# Results

## Result

Once the search is complete, the UI shows extensive information about the search results.


<img align="right" src="https://github.com/Decimation/SmartImage/raw/master/Examples/Example%20search%20results.png" width=591.5 height=391.5>

<p style="text-align: left;">

- **Result**: Most accurate and specific result URL
- **Raw**: Undifferentiated result URL
- **Direct**: Direct image URL
- **Similarity**: Image similarity (delta)
- **Description**: Image description, caption, etc.
- **Site**: Result site<sup>1</sup>
- **Artist**: Image artist<sup>1</sup>
- **Characters**: Character(s) in the image<sup>1</sup>
- **Source**: Image source<sup>1</sup>
- **Resolution**: Image resolution
- **Detail score**: Number of detail fields
- **Other image results**: Other results

</p>


<sup>1</sup> This metadata is usually only for anime or related image results (i.e. *SauceNao*, *IQDB*, *TraceMoe*, etc.)

# Interaction

## General

- Press the option character on the keyboard to open it (i.e., press **0** to open **[0]** or **A** to open **[A]**).
- Press `Escape` to return to the previous interface.
- Press `F1` to show filtered results.
- Press `F5` to refresh the console buffer.

## Results

- Press the result character to open the **Result** URL in your browser.
- Hold down `Ctrl` to search for a direct image link.
- Hold down `Alt` to show more info and results. Certain engines will return multiple results; those can be viewed using this option.
- Hold down `Shift` to open the raw URL.
- Hold down `Ctrl` and `Alt` to download the image.
22 changes: 22 additions & 0 deletions Assets/Legacy2_Usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Input

**SmartImage** can be used in a variety of ways.
- Input text field in the main menu
- Copy/paste text
- Use the *Browse* button to open the file picker dialog
- Context menu
- Use the *Config* button to open the [configuration dialog](https://github.com/Decimation/SmartImage/wiki/Interface#configuration) to toggle context menu integration
- Clipboard
- copying an _image_ or _URI_ outside of the program will automatically populate the input field
- Command line
- Use the `--i` parameter to specify input

# Queries

The value given as [input](#Input) is referred to hereafter as _search query_ or _query_.

* Search queries may be either a _file_ or _URI_.
* All queries must be a recognized image type.
* If query is a _URI_, it must be a direct link (i.e., the payload returned is a binary image). For example, `https://i.imgur.com/zoBIh8t.jpg` returns
an image payload with `Content-Type` as `image/jpeg`.

32 changes: 32 additions & 0 deletions Assets/Wiki_TOC_Old.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## [Home](https://github.com/Decimation/SmartImage/wiki)
- [Engines](https://github.com/Decimation/SmartImage/wiki/Engines)
- Miscellaneous
- [Reviews](https://github.com/Decimation/SmartImage/wiki/Reviews)

***

## GUI
- [Usage](https://github.com/Decimation/SmartImage/wiki/Usage)
- [Main Menu](https://github.com/Decimation/SmartImage/wiki/Usage#main-menu)
- [Results](https://github.com/Decimation/SmartImage/wiki/Usage#results)
- [Configuration](https://github.com/Decimation/SmartImage/wiki/Usage#configuration)


***

### Legacy²
- [Interface](https://github.com/Decimation/SmartImage/wiki/Interface-(Legacy²))
- [Main Menu](https://github.com/Decimation/SmartImage/wiki/Interface-(Legacy²)#main-menu)
- [Configuration](https://github.com/Decimation/SmartImage/wiki/Interface-(Legacy²)#configuration)
- [Results](https://github.com/Decimation/SmartImage/wiki/Interface-(Legacy²)#results)
- [Usage](https://github.com/Decimation/SmartImage/wiki/Usage-(Legacy²))
- [Input](https://github.com/Decimation/SmartImage/wiki/Usage-(Legacy²)#Input)

***

### [Legacy](https://github.com/Decimation/SmartImage/wiki/Home-(Legacy))¹
<!--
- [Command Line](https://github.com/Decimation/SmartImage/wiki/Command-Line-(Legacy))
- [Configuration](https://github.com/Decimation/SmartImage/wiki/Configuration-(Legacy))
- [Interface](https://github.com/Decimation/SmartImage/wiki/Interface-(Legacy))
-->
7 changes: 5 additions & 2 deletions SmartImage.Lib 3/Engines/Impl/Search/FluffleEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public override async Task<SearchResult> GetResultAsync(SearchQuery query, Cance
var item = result.Convert(sr, out var c);
sr.Results.Add(item);
}


sr.Update();
return sr;
}

Expand All @@ -91,7 +92,9 @@ protected override async ValueTask<Url> GetRawUrlAsync(SearchQuery query)

public override SearchEngineOptions EngineOption => SearchEngineOptions.Fluffle;

public override void Dispose() { }
public override void Dispose()
{
}

}

Expand Down
1 change: 1 addition & 0 deletions SmartImage.Lib 3/SmartImage.Lib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Configurations>Debug;Release;Test</Configurations>
<DefineConstants>JETBRAINS_ANNOTATIONS;TRACE</DefineConstants>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<PublishTrimmed>True</PublishTrimmed>
<!-- <PublishSingleFile>true</PublishSingleFile> -->
<PublishSingleFile Condition="'$(Configuration)' == 'Release|AnyCPU'">true</PublishSingleFile>
Expand Down
Loading

0 comments on commit de57f00

Please sign in to comment.