Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - restore previous state #21

Closed
younyokel opened this issue Feb 25, 2024 · 2 comments
Closed

Feature request - restore previous state #21

younyokel opened this issue Feb 25, 2024 · 2 comments

Comments

@younyokel
Copy link

Useful feature when you accidentally close the app, and when you open it again, it restores the previous path and file from where I left off

@Nenotriple
Copy link
Owner

That sounds like a good suggestion.


Here's how I'll make work:

When closing the app, a settings.cfg file will be created with the last_directory and last_index values.

When launching the app, the settings file is read, and if the path is valid, you'll be asked if you want to reload the last directory.


It'd be pretty easy to add other settings, but for now, it just restores the directory and index. I'm making these changes locally, so this feature will be included in the next release.

Thanks!

Nenotriple added a commit that referenced this issue Feb 28, 2024
  - New:

    - `Find Duplicate Files`: Quickly find and separate duplicate images in your dataset.
      - This works by checking cross checking file hash - 2GB file limit. Can be used for all files
      - Built as a stand alone tool.

    - `Rename/convert img-txt Pairs`: Easily rename and convert your dataset in a clean format.
      - All images are converted to ".jpg" format to prevent duplicate filename issues.
      - JPG conversion quality is set to 100, this ensures a small file size and no visible compression will be added for most conversions.
      - Example: 00001.jpg, 00001.txt.

    - `Expand Current Image`: Expand images to a square resolution without cropping.
      - This tool makes an image square by extending its shorter side to match the length of its longer side, after rounding that length down to the nearest multiple of 8.
      - The empty space is then filled by expanding the border of pixels from the long side.

    - `Crop Image`: Crop the currently displayed image.
      - Currently only supports cropping by square (1:1) or freeform.
      - Double click to quickly create a 512x512 or 1024x1024 rectangle (automatically decided based on image size)
      - Right the image to open the context menu and select either Crop, Clear, or Open Directory.
      - Mousewheel to resize the rectangle.

    - `Flip Image`: Flip the currently displayed image horizontally.
    - `Rotate Image`: Rotate the the currently displayed image 90 degrees.
    - `Duplicate Pair`: Duplicate the currently displayed img-txt pair.

    - `Filter Pairs` Changes:
      - New option to display only empty text files.
      - Use `!` before the text to exclude any pairs containing that text.
      - Use `+` between text to include multiple strings when filtering.
      - Example: `!dog + cat` (remove dog pairs, display cat pairs)

    - `Resize Images` v1.01 Changes:
      - You can now choose image filetype for the resized output.
      - You can now set the `Resize Condition` to the following modes:
        - `Upscale and Downscale`, Resize the image to the new dimensions regardless of whether they are larger or smaller than the original dimensions.
        - `Upscale Only`, Resize the image if the new dimensions are larger than the original dimensions.
        - `Downscale Only`, Resize the image if the new dimensions are smaller than the original dimensions

    - `Batch Tag Delete` v1.07 Changes:
        - Significantly improved the speed tags are deleted.
        - You can now choose a new directory after opening the app.

    - Text Box changes:
        - The displayed text can now be refreshed from the right-click text_box context menu. (Hotkey: F5)
        - You can now select text and add it to the custom dictionary with the right click context menu.

    - Image info is now displayed above the current image (filename, resolution, size)
    - The last directory and index can now be quickly restored when launching the app. #21


<br>


  - Fixed:

    - Fixed image scaling regression that prevented images from scaling to fill the frame.
    - Fixed issue where the image index would no longer sort correctly after files were added or removed from the working directory.
    - Fixed issue where a new text file wasn't being created when saving the text box.
    - Fixed Auto-Save not triggering when loading a new directory.


<br>


  - Other changes:

    - "file_watcher" logic has been removed.
      - This was used to update the index or text box when changes occured outside the apps influence.
      - It was easier to remove then fix the issues with threading...

    - Removed the following from the script. These changes do not effect exe users:
        - Automatic check and install of Pillow.
        - Automatic check and download of dictionary files.
        - `threading` and `requests` imports removed.

    - UI changes.
        - The directory button is replaced with a text entry, browse/open buttons, and a right-click context menu.
        - Added descriptions below each tool along the bottom toolbar.
        - The save button can now be set to double height by right clicking it, or from the Options menu. #19
        - And other small changes.

    - Max Image size values have been slightly reduced to improve performance when scaling the image within the UI.
    - "Delete Pair" keyboard shortcut changed from `Del` to `Shift+Del`. #19
    - You can now pick any combination of autocomplete dictionaries.
@Nenotriple
Copy link
Owner

I've posted v1.90 with these changes.

because you requested something like this before, I also wanted to point out a couple of new features related to blank/empty text files

The Filter Pairs tool can now filter just empty text files.

You can now quickly jump to the next empty text file from Tools menu or by pressing Ctrl+E.

Hopefully you find those somewhat useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants